[Openmp-dev] r239337 - Remove unused variables '__kmp_build_check_*'

Peyton, Jonathan L jonathan.l.peyton at intel.com
Thu Jun 11 10:41:36 PDT 2015


Committed revision 239546.

I changed it a little bit so that there is a new CACHED CMake variable LIBOMP_ENABLE_ASSERTIONS which can be set in standalone builds or take on the value of LLVM_ENABLE_ASSERTIONS in LLVM builds.

-- Johnny

-----Original Message-----
From: Jack Howarth [mailto:howarth.mailing.lists at gmail.com] 
Sent: Wednesday, June 10, 2015 7:34 AM
To: Peyton, Jonathan L; openmp-dev at dcs-maillist2.engr.illinois.edu
Subject: Re: r239337 - Remove unused variables '__kmp_build_check_*'

Jonathan,
       The attached patch implements the requested change. We needed to mimic the behavior of the KA_TRACE() macros rather than the
KMP_ASSERT() and KMP_DEBUG_ASSERT() macros. With this change, the build of openmp in the llvm tree completes on x86_64-apple-darwin14 using clang 3.6.1 without unused-typedef warnings for
__kmp_build_check_* when cmake is passed -DLLVM_ENABLE_ASSERTIONS=OFF.
                     Jack

On Tue, Jun 9, 2015 at 11:52 AM, Jack Howarth <howarth.mailing.lists at gmail.com> wrote:
> Jonathan,
>       Are you sure that the __kmp_build_check_* symbols generated from 
> the KMP_BUILD_ASSERT macros aren't dead code in openmp? I find that 
> the following patch eliminates the warnings....
>
> warning: unused typedef '__kmp_build_check_492' 
> [-Wunused-local-typedef]
>
> when the toplevel llvm build is passed-DLLVM_ENABLE_ASSERTIONS=OFF but 
> they still remain for -DLLVM_ENABLE_ASSERTIONS=ON.
>                  Jack
>
>
> On Mon, Jun 8, 2015 at 7:54 PM, Jack Howarth 
> <howarth.mailing.lists at gmail.com> wrote:
>> Jonathan,
>>      The commit...
>>
>> http://lists.cs.uiuc.edu/pipermail/openmp-commits/2015-June/000339.ht
>> ml
>>
>> only converts the unused-variable warnings for __kmp_build_check_* 
>> into unused typedef warnings. My initial inclination was to test 
>> adding...
>>
>> #ifdef KMP_USE_ASSERT
>> ...
>> #endif
>>
>> preprocessor wrappers around all of the calls to the KMP_BUILD_ASSERT 
>> macro. However this doesn't work since the openmp build passes  -D 
>> KMP_USE_ASSERT to the compiler flags in the cmake build of openmp in 
>> the llvm tree. This occurs for a cmake build which pass passed 
>> -DLLVM_ENABLE_ASSERTIONS=OFF for the top-level cmake options.
>> Shouldn't KMP_USE_ASSERT be disabled in that case or are those two 
>> usages of asserts unrelated?
>>               Jack




More information about the Openmp-dev mailing list