[llvm] r307825 - [libFuzzer] NFC Declare LIBFUZZER_FLAGS_BASE outside of an if-block

George Karpenkov via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 11:16:10 PDT 2017


Author: george.karpenkov
Date: Wed Jul 12 11:16:09 2017
New Revision: 307825

URL: http://llvm.org/viewvc/llvm-project?rev=307825&view=rev
Log:
[libFuzzer] NFC Declare LIBFUZZER_FLAGS_BASE outside of an if-block

The current code relies on the assumption that tests are included only
if LLVM_USE_SANITIZE_COVERAGE is enabled.
This commit makes it easier to relax the assumption in the future, as
the variable LIBFUZZER_FLAGS_BASE is used further in libFuzzer tests.

Differential Revision: https://reviews.llvm.org/D35314

Modified:
    llvm/trunk/lib/Fuzzer/CMakeLists.txt

Modified: llvm/trunk/lib/Fuzzer/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/CMakeLists.txt?rev=307825&r1=307824&r2=307825&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/CMakeLists.txt (original)
+++ llvm/trunk/lib/Fuzzer/CMakeLists.txt Wed Jul 12 11:16:09 2017
@@ -13,6 +13,7 @@ if( APPLE )
   endif()
 endif()
 
+set(LIBFUZZER_FLAGS_BASE "${CMAKE_CXX_FLAGS}")
 if( LLVM_USE_SANITIZE_COVERAGE )
   if(NOT "${LLVM_USE_SANITIZER}" STREQUAL "Address")
     message(FATAL_ERROR
@@ -20,7 +21,6 @@ if( LLVM_USE_SANITIZE_COVERAGE )
       "LLVM_USE_SANITIZE_COVERAGE=YES to be set."
       )
   endif()
-  set(LIBFUZZER_FLAGS_BASE "${CMAKE_CXX_FLAGS}")
 
   # Disable the coverage and sanitizer instrumentation for the fuzzer itself.
   set(CMAKE_CXX_FLAGS "${LIBFUZZER_FLAGS_BASE} -fno-sanitize-coverage=trace-pc-guard,edge,trace-cmp,indirect-calls,8bit-counters -Werror")




More information about the llvm-commits mailing list