mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 20:56:06 +00:00
[OMPT] Resolve warnings because of ints in if conditions
The implementation status can only be one of ompt_event_UNIMPLEMENTED = ompt_set_never = 1 ompt_event_MAY_ALWAYS = ompt_set_always = 5 In both cases, the condition was already true, so just remove the check. Differential Revision: https://reviews.llvm.org/D65869 llvm-svn: 369001
This commit is contained in:
parent
2fc20f652c
commit
fb72a03f85
@ -31,7 +31,6 @@ function(libomp_get_cxxflags cxxflags)
|
||||
libomp_append(flags_local -Wno-covered-switch-default LIBOMP_HAVE_WNO_COVERED_SWITCH_DEFAULT_FLAG)
|
||||
libomp_append(flags_local -Wno-frame-address LIBOMP_HAVE_WNO_FRAME_ADDRESS_FLAG)
|
||||
libomp_append(flags_local -Wno-implicit-fallthrough LIBOMP_HAVE_WNO_IMPLICIT_FALLTHROUGH_FLAG)
|
||||
libomp_append(flags_local -Wno-int-in-bool-context LIBOMP_HAVE_WNO_INT_IN_BOOL_CONTEXT_FLAG)
|
||||
libomp_append(flags_local -Wno-missing-braces LIBOMP_HAVE_WNO_MISSING_BRACES_FLAG)
|
||||
libomp_append(flags_local -Wno-parentheses LIBOMP_HAVE_WNO_PARENTHESES_FLAG)
|
||||
libomp_append(flags_local -Wno-strict-aliasing LIBOMP_HAVE_WNO_STRICT_ALIASING_FLAG)
|
||||
|
@ -52,7 +52,6 @@ check_cxx_compiler_flag(-Wno-class-memaccess LIBOMP_HAVE_WNO_CLASS_MEMACCESS_FLA
|
||||
check_cxx_compiler_flag(-Wno-covered-switch-default LIBOMP_HAVE_WNO_COVERED_SWITCH_DEFAULT_FLAG)
|
||||
check_cxx_compiler_flag(-Wno-frame-address LIBOMP_HAVE_WNO_FRAME_ADDRESS_FLAG)
|
||||
check_cxx_compiler_flag(-Wno-implicit-fallthrough LIBOMP_HAVE_WNO_IMPLICIT_FALLTHROUGH_FLAG)
|
||||
check_cxx_compiler_flag(-Wno-int-in-bool-context LIBOMP_HAVE_WNO_INT_IN_BOOL_CONTEXT_FLAG)
|
||||
check_cxx_compiler_flag(-Wno-missing-braces LIBOMP_HAVE_WNO_MISSING_BRACES_FLAG)
|
||||
check_cxx_compiler_flag(-Wno-parentheses LIBOMP_HAVE_WNO_PARENTHESES_FLAG)
|
||||
check_cxx_compiler_flag(-Wno-strict-aliasing LIBOMP_HAVE_WNO_STRICT_ALIASING_FLAG)
|
||||
|
@ -430,10 +430,8 @@ OMPT_API_ROUTINE ompt_set_result_t ompt_set_callback(ompt_callbacks_t which,
|
||||
|
||||
#define ompt_event_macro(event_name, callback_type, event_id) \
|
||||
case event_name: \
|
||||
if (ompt_event_implementation_status(event_name)) { \
|
||||
ompt_callbacks.ompt_callback(event_name) = (callback_type)callback; \
|
||||
ompt_enabled.event_name = (callback != 0); \
|
||||
} \
|
||||
ompt_callbacks.ompt_callback(event_name) = (callback_type)callback; \
|
||||
ompt_enabled.event_name = (callback != 0); \
|
||||
if (callback) \
|
||||
return ompt_event_implementation_status(event_name); \
|
||||
else \
|
||||
@ -456,16 +454,15 @@ OMPT_API_ROUTINE int ompt_get_callback(ompt_callbacks_t which,
|
||||
switch (which) {
|
||||
|
||||
#define ompt_event_macro(event_name, callback_type, event_id) \
|
||||
case event_name: \
|
||||
if (ompt_event_implementation_status(event_name)) { \
|
||||
ompt_callback_t mycb = \
|
||||
(ompt_callback_t)ompt_callbacks.ompt_callback(event_name); \
|
||||
if (ompt_enabled.event_name && mycb) { \
|
||||
*callback = mycb; \
|
||||
return ompt_get_callback_success; \
|
||||
} \
|
||||
case event_name: { \
|
||||
ompt_callback_t mycb = \
|
||||
(ompt_callback_t)ompt_callbacks.ompt_callback(event_name); \
|
||||
if (ompt_enabled.event_name && mycb) { \
|
||||
*callback = mycb; \
|
||||
return ompt_get_callback_success; \
|
||||
} \
|
||||
return ompt_get_callback_failure;
|
||||
return ompt_get_callback_failure; \
|
||||
}
|
||||
|
||||
FOREACH_OMPT_EVENT(ompt_event_macro)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user