[llvm] r317725 - [cmake] Allow LLVM_BUILD_INSTRUMENTED to be set to IR or Frontend
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 8 13:26:40 PST 2017
Author: vedantk
Date: Wed Nov 8 13:26:40 2017
New Revision: 317725
URL: http://llvm.org/viewvc/llvm-project?rev=317725&view=rev
Log:
[cmake] Allow LLVM_BUILD_INSTRUMENTED to be set to IR or Frontend
- This deprecates LLVM_ENABLE_IR_PGO but keeps it around for now.
- Errors out when LLVM_BUILD_INSTRUMENTED and LLVM_BUILD_INSTRUMENTED_COVERAGE
are both set.
Motivated by bogner's post-commit review of r313770.
Modified:
llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=317725&r1=317724&r2=317725&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Wed Nov 8 13:26:40 2017
@@ -738,14 +738,15 @@ if(LLVM_ENABLE_EH AND NOT LLVM_ENABLE_RT
message(FATAL_ERROR "Exception handling requires RTTI. You must set LLVM_ENABLE_RTTI to ON")
endif()
-option(LLVM_ENABLE_IR_PGO "Build LLVM and tools with IR PGO instrumentation (experimental)" Off)
+option(LLVM_ENABLE_IR_PGO "Build LLVM and tools with IR PGO instrumentation (deprecated)" Off)
mark_as_advanced(LLVM_ENABLE_IR_PGO)
-option(LLVM_BUILD_INSTRUMENTED "Build LLVM and tools with PGO instrumentation" Off)
+set(LLVM_BUILD_INSTRUMENTED OFF CACHE STRING "Build LLVM and tools with PGO instrumentation. May be specified as IR or Frontend")
mark_as_advanced(LLVM_BUILD_INSTRUMENTED)
+string(TOUPPER "${LLVM_BUILD_INSTRUMENTED}" uppercase_LLVM_BUILD_INSTRUMENTED)
if (LLVM_BUILD_INSTRUMENTED)
- if (LLVM_ENABLE_IR_PGO)
+ if (LLVM_ENABLE_IR_PGO OR uppercase_LLVM_BUILD_INSTRUMENTED STREQUAL "IR")
append("-fprofile-generate='${LLVM_PROFILE_DATA_DIR}'"
CMAKE_CXX_FLAGS
CMAKE_C_FLAGS
@@ -768,6 +769,10 @@ append_if(LLVM_BUILD_INSTRUMENTED_COVERA
CMAKE_EXE_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS)
+if (LLVM_BUILD_INSTRUMENTED AND LLVM_BUILD_INSTRUMENTED_COVERAGE)
+ message(FATAL_ERROR "LLVM_BUILD_INSTRUMENTED and LLVM_BUILD_INSTRUMENTED_COVERAGE cannot both be specified")
+endif()
+
if(LLVM_ENABLE_LTO AND LLVM_ON_WIN32 AND NOT LINKER_IS_LLD_LINK)
message(FATAL_ERROR "When compiling for Windows, LLVM_ENABLE_LTO requires using lld as the linker (point CMAKE_LINKER at lld-link.exe)")
endif()
More information about the llvm-commits
mailing list