From d2eb3c73ad92b94cf8a6f63a4fd396ff3fd3b47c Mon Sep 17 00:00:00 2001 From: Jonathan Peyton Date: Wed, 26 Aug 2015 20:02:21 +0000 Subject: [PATCH] Put taskdata variables under KMP_DEBUG guards. These variables are only used in the TRACE macros and so don't need to be defined unless compiling in debug mode. llvm-svn: 246067 --- openmp/runtime/src/kmp_taskdeps.cpp | 5 +++-- openmp/runtime/src/kmp_tasking.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/openmp/runtime/src/kmp_taskdeps.cpp b/openmp/runtime/src/kmp_taskdeps.cpp index abc037b5f0ca..35dd995956a2 100644 --- a/openmp/runtime/src/kmp_taskdeps.cpp +++ b/openmp/runtime/src/kmp_taskdeps.cpp @@ -287,9 +287,10 @@ __kmp_check_deps ( kmp_int32 gtid, kmp_depnode_t *node, kmp_task_t *task, kmp_de kmp_int32 ndeps_noalias, kmp_depend_info_t *noalias_dep_list ) { int i; - kmp_taskdata_t * taskdata; - taskdata = KMP_TASK_TO_TASKDATA(task); +#if KMP_DEBUG + kmp_taskdata_t * taskdata = KMP_TASK_TO_TASKDATA(task); +#endif KA_TRACE(20, ("__kmp_check_deps: T#%d checking dependencies for task %p : %d possibly aliased dependencies, %d non-aliased depedencies : dep_barrier=%d .\n", gtid, taskdata, ndeps, ndeps_noalias, dep_barrier ) ); // Filter deps in dep_list diff --git a/openmp/runtime/src/kmp_tasking.c b/openmp/runtime/src/kmp_tasking.c index 4bb44349d857..647f241e4b57 100644 --- a/openmp/runtime/src/kmp_tasking.c +++ b/openmp/runtime/src/kmp_tasking.c @@ -1276,10 +1276,11 @@ __kmp_omp_task( kmp_int32 gtid, kmp_task_t * new_task, bool serialize_immediate kmp_int32 __kmpc_omp_task( ident_t *loc_ref, kmp_int32 gtid, kmp_task_t * new_task) { - kmp_taskdata_t * new_taskdata; kmp_int32 res; - new_taskdata = KMP_TASK_TO_TASKDATA(new_task); +#if KMP_DEBUG + kmp_taskdata_t * new_taskdata = KMP_TASK_TO_TASKDATA(new_task); +#endif KA_TRACE(10, ("__kmpc_omp_task(enter): T#%d loc=%p task=%p\n", gtid, loc_ref, new_taskdata ) );