Skip to content

Commit f8d081c

Browse files
author
Jonathan Peyton
committed
[OpenMP][libomp] Allow unused-but-set warnings
Only a few remaining which are taken care of by this patch. Differential Revision: https://reviews.llvm.org/D133528
1 parent ba7da14 commit f8d081c

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

openmp/runtime/cmake/LibompHandleFlags.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ function(libomp_get_cxxflags cxxflags)
3535
libomp_append(flags_local -Wno-stringop-truncation LIBOMP_HAVE_WNO_STRINGOP_TRUNCATION_FLAG)
3636
libomp_append(flags_local -Wno-switch LIBOMP_HAVE_WNO_SWITCH_FLAG)
3737
libomp_append(flags_local -Wno-uninitialized LIBOMP_HAVE_WNO_UNINITIALIZED_FLAG)
38-
libomp_append(flags_local -Wno-unused-but-set-variable LIBOMP_HAVE_WNO_UNUSED_BUT_SET_VARIABLE_FLAG)
3938
libomp_append(flags_local -Wno-return-type-c-linkage LIBOMP_HAVE_WNO_RETURN_TYPE_C_LINKAGE_FLAG)
4039
libomp_append(flags_local -Wno-cast-qual LIBOMP_HAVE_WNO_CAST_QUAL_FLAG)
4140
libomp_append(flags_local -Wno-int-to-void-pointer-cast LIBOMP_HAVE_WNO_INT_TO_VOID_POINTER_CAST_FLAG)

openmp/runtime/cmake/config-ix.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ check_cxx_compiler_flag(-Wstringop-overflow=0 LIBOMP_HAVE_WSTRINGOP_OVERFLOW_FLA
5858
check_cxx_compiler_flag(-Wno-stringop-truncation LIBOMP_HAVE_WNO_STRINGOP_TRUNCATION_FLAG)
5959
check_cxx_compiler_flag(-Wno-switch LIBOMP_HAVE_WNO_SWITCH_FLAG)
6060
check_cxx_compiler_flag(-Wno-uninitialized LIBOMP_HAVE_WNO_UNINITIALIZED_FLAG)
61-
check_cxx_compiler_flag(-Wno-unused-but-set-variable LIBOMP_HAVE_WNO_UNUSED_BUT_SET_VARIABLE_FLAG)
6261
check_cxx_compiler_flag(-Wno-return-type-c-linkage LIBOMP_HAVE_WNO_RETURN_TYPE_C_LINKAGE_FLAG)
6362
check_cxx_compiler_flag(-Wno-cast-qual LIBOMP_HAVE_WNO_CAST_QUAL_FLAG)
6463
check_cxx_compiler_flag(-Wno-int-to-void-pointer-cast LIBOMP_HAVE_WNO_INT_TO_VOID_POINTER_CAST_FLAG)

openmp/runtime/src/kmp_affinity.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3301,7 +3301,6 @@ static bool __kmp_affinity_create_cpuinfo_map(int *line,
33013301
for (i = 0; i < num_avail; ++i) {
33023302
unsigned os = threadInfo[i][osIdIndex];
33033303
int src_index;
3304-
int dst_index = 0;
33053304
kmp_hw_thread_t &hw_thread = __kmp_topology->at(i);
33063305
hw_thread.clear();
33073306
hw_thread.os_id = os;
@@ -3318,7 +3317,6 @@ static bool __kmp_affinity_create_cpuinfo_map(int *line,
33183317
} else if (src_index == threadIdIndex) {
33193318
hw_thread.ids[threadLevel] = threadInfo[i][src_index];
33203319
}
3321-
dst_index++;
33223320
}
33233321
}
33243322

openmp/runtime/src/z_Linux_util.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2242,8 +2242,9 @@ int __kmp_get_load_balance(int max) {
22422242
int stat_file = -1;
22432243
int stat_path_fixed_len;
22442244

2245+
#ifdef KMP_DEBUG
22452246
int total_processes = 0; // Total number of processes in system.
2246-
int total_threads = 0; // Total number of threads in system.
2247+
#endif
22472248

22482249
double call_time = 0.0;
22492250

@@ -2290,7 +2291,9 @@ int __kmp_get_load_balance(int max) {
22902291
// process' directory.
22912292
if (proc_entry->d_type == DT_DIR && isdigit(proc_entry->d_name[0])) {
22922293

2294+
#ifdef KMP_DEBUG
22932295
++total_processes;
2296+
#endif
22942297
// Make sure init process is the very first in "/proc", so we can replace
22952298
// strcmp( proc_entry->d_name, "1" ) == 0 with simpler total_processes ==
22962299
// 1. We are going to check that total_processes == 1 => d_name == "1" is
@@ -2331,7 +2334,6 @@ int __kmp_get_load_balance(int max) {
23312334
while (task_entry != NULL) {
23322335
// It is a directory and name starts with a digit.
23332336
if (proc_entry->d_type == DT_DIR && isdigit(task_entry->d_name[0])) {
2334-
++total_threads;
23352337

23362338
// Construct complete stat file path. Easiest way would be:
23372339
// __kmp_str_buf_print( & stat_path, "%s/%s/stat", task_path.str,

0 commit comments

Comments
 (0)