summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-10-13 05:35:12 +0000
committerChris Bieneman <beanz@apple.com>2015-10-13 05:35:12 +0000
commit1c8928091655a5f57f9ff71bbf323413b526f98d (patch)
tree439f957233a31c7895bdd766b5494a6085ae83e7
parent334d46150dc613d78a514e127c9fea83b22fc914 (diff)
downloadbcm5719-llvm-1c8928091655a5f57f9ff71bbf323413b526f98d.tar.gz
bcm5719-llvm-1c8928091655a5f57f9ff71bbf323413b526f98d.zip
[CMake] LLVM_PROFDATA_FILE only works if you're using clang, so we should error out if it is specified when not using clang.
Also updated the CMake docs. Based on post-commit review of r250108 from Sean Silvas. llvm-svn: 250150
-rw-r--r--llvm/CMakeLists.txt6
-rw-r--r--llvm/docs/CMake.rst4
2 files changed, 9 insertions, 1 deletions
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 2a2291c7822..d420e64228a 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -594,7 +594,11 @@ set(LLVM_PROFDATA_FILE "" CACHE FILEPATH
"Profiling data file to use when compiling in order to improve runtime performance.")
if(LLVM_PROFDATA_FILE AND EXISTS ${LLVM_PROFDATA_FILE})
- add_definitions("-fprofile-instr-use=${LLVM_PROFDATA_FILE}")
+ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+ add_definitions("-fprofile-instr-use=${LLVM_PROFDATA_FILE}")
+ else()
+ message(FATAL_ERROR "LLVM_PROFDATA_FILE can only be specified when compiling with clang")
+ endif()
endif()
include(AddLLVM)
diff --git a/llvm/docs/CMake.rst b/llvm/docs/CMake.rst
index 49657ba2dd8..0810bed90d4 100644
--- a/llvm/docs/CMake.rst
+++ b/llvm/docs/CMake.rst
@@ -334,6 +334,10 @@ LLVM-specific variables
**LLVM_USE_OPROFILE**:BOOL
Enable building OProfile JIT support. Defaults to OFF.
+**LLVM_PROFDATA_FILE**:PATH
+ Path to a profdata file to pass into clang's -fprofile-instr-use flag. This
+ can only be specified if you're building with clang.
+
**LLVM_USE_INTEL_JITEVENTS**:BOOL
Enable building support for Intel JIT Events API. Defaults to OFF.
OpenPOWER on IntegriCloud