From: Chris Bieneman Date: Mon, 12 Oct 2015 21:13:20 +0000 (+0000) Subject: [CMake] Adding support for passing in profiling data. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ce28cbb5077c068af4f24d1e04b8ddfa54a2261c;p=oota-llvm.git [CMake] Adding support for passing in profiling data. Adds LLVM_PROFDATA_FILE option to allow specifying a profile data file to be used during compilation of LLVM and subprojects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250108 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c7517eea0d..2a2291c7822 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -590,6 +590,13 @@ endif( ${CMAKE_SYSTEM_NAME} MATCHES SunOS ) # use export_executable_symbols(target). set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") +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}") +endif() + include(AddLLVM) include(TableGen)