diff options
author | Jonas Hahnfeld <hahnjo@hahnjo.de> | 2017-11-09 15:52:25 +0000 |
---|---|---|
committer | Jonas Hahnfeld <hahnjo@hahnjo.de> | 2017-11-09 15:52:25 +0000 |
commit | aeb40adabf18d517fa27085d3e39cb2b93eb7648 (patch) | |
tree | e4c1bb4635181b54f8b07352cccdc8678aaa70f2 /openmp/runtime/src/kmp_sched.cpp | |
parent | 18ff303bed72782f05cfc9b87ed38d788edbdf07 (diff) | |
download | bcm5719-llvm-aeb40adabf18d517fa27085d3e39cb2b93eb7648.tar.gz bcm5719-llvm-aeb40adabf18d517fa27085d3e39cb2b93eb7648.zip |
Remove const from variables with dynamic memory
Allocated memory is typically not 'const' if it needs to be freed.
This patch removes around 50 wrong const attributes, modifies the
corresponding functions and finally gets rid of some const_casts.
These have especially been strange for __kmp_str_fname_free() that
added a 'const' to call __kmp_str_free() which removed it again.
Two minor cleanups that I performed in this process:
* __kmp_tool_libraries now lives in kmp_settings.cpp as it is
used nowhere else.
* __kmp_msg_empty was removed as it was never used and Clang
now complained that it was assigned a string literal that
is 'const char *'.
Differential Revision: https://reviews.llvm.org/D39755
llvm-svn: 317797
Diffstat (limited to 'openmp/runtime/src/kmp_sched.cpp')
-rw-r--r-- | openmp/runtime/src/kmp_sched.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/openmp/runtime/src/kmp_sched.cpp b/openmp/runtime/src/kmp_sched.cpp index 4a878e3e944..9960859eda4 100644 --- a/openmp/runtime/src/kmp_sched.cpp +++ b/openmp/runtime/src/kmp_sched.cpp @@ -93,7 +93,7 @@ static void __kmp_for_static_init(ident_t *loc, kmp_int32 global_tid, KE_TRACE(10, ("__kmpc_for_static_init called (%d)\n", global_tid)); #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format( "__kmpc_for_static_init: T#%%d sched=%%d liter=%%d iter=(%%%s," @@ -125,7 +125,7 @@ static void __kmp_for_static_init(ident_t *loc, kmp_int32 global_tid, // ON A ZERO-TRIP LOOP (lower=1, upper=0,stride=1) - JPH June 23, 2009. #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmpc_for_static_init:(ZERO TRIP) liter=%%d " "lower=%%%s upper=%%%s stride = %%%s " @@ -179,7 +179,7 @@ static void __kmp_for_static_init(ident_t *loc, kmp_int32 global_tid, #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmpc_for_static_init: (serial) liter=%%d " "lower=%%%s upper=%%%s stride = %%%s\n", @@ -208,7 +208,7 @@ static void __kmp_for_static_init(ident_t *loc, kmp_int32 global_tid, (incr > 0) ? (*pupper - *plower + 1) : (-(*plower - *pupper + 1)); #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmpc_for_static_init: (serial) liter=%%d " "lower=%%%s upper=%%%s stride = %%%s\n", @@ -365,7 +365,7 @@ static void __kmp_for_static_init(ident_t *loc, kmp_int32 global_tid, #endif #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmpc_for_static_init: liter=%%d lower=%%%s " "upper=%%%s stride = %%%s signed?<%s>\n", @@ -410,7 +410,7 @@ static void __kmp_dist_for_static_init(ident_t *loc, kmp_int32 gtid, KE_TRACE(10, ("__kmpc_dist_for_static_init called (%d)\n", gtid)); #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format( "__kmpc_dist_for_static_init: T#%%d schedLoop=%%d liter=%%d " @@ -613,7 +613,7 @@ static void __kmp_dist_for_static_init(ident_t *loc, kmp_int32 gtid, end:; #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format( "__kmpc_dist_for_static_init: last=%%d lo=%%%s up=%%%s upDist=%%%s " @@ -654,7 +654,7 @@ static void __kmp_team_static_init(ident_t *loc, kmp_int32 gtid, KE_TRACE(10, ("__kmp_team_static_init called (%d)\n", gtid)); #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_team_static_init enter: T#%%d liter=%%d " "iter=(%%%s, %%%s, %%%s) chunk %%%s; signed?<%s>\n", @@ -728,7 +728,7 @@ static void __kmp_team_static_init(ident_t *loc, kmp_int32 gtid, } #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_team_static_init exit: T#%%d team%%u liter=%%d " |