[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.

llvm-svn: 250108
This commit is contained in:
Chris Bieneman 2015-10-12 21:13:20 +00:00
parent ee44e2401b
commit 9ad0380b85
1 changed files with 7 additions and 0 deletions

View File

@ -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)