From: Rong Xu Date: Fri, 8 Feb 2019 19:31:03 +0000 (+0000) Subject: [Cmake] Add an option to build LLVM using the experimental new pass manager X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=52585b5d4c289d484ee7e4c12294296d79d61502;p=llvm [Cmake] Add an option to build LLVM using the experimental new pass manager Add LLVM_USE_NEWPM to build LLVM using the experimental new pass manager. Differential Revision: http://reviews.llvm.org/D57068 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353550 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake index 49db3088bbc..ca53f7f38ee 100644 --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/cmake/modules/HandleLLVMOptions.cmake @@ -784,6 +784,16 @@ if(LLVM_ENABLE_EH AND NOT LLVM_ENABLE_RTTI) message(FATAL_ERROR "Exception handling requires RTTI. You must set LLVM_ENABLE_RTTI to ON") endif() +option(LLVM_USE_NEWPM "Build LLVM using the experimental new pass manager" Off) +mark_as_advanced(LLVM_USE_NEWPM) +if (LLVM_USE_NEWPM) + append("-fexperimental-new-pass-manager" + CMAKE_CXX_FLAGS + CMAKE_C_FLAGS + CMAKE_EXE_LINKER_FLAGS + CMAKE_SHARED_LINKER_FLAGS) +endif() + option(LLVM_ENABLE_IR_PGO "Build LLVM and tools with IR PGO instrumentation (deprecated)" Off) mark_as_advanced(LLVM_ENABLE_IR_PGO) diff --git a/docs/CMake.rst b/docs/CMake.rst index eb219c58560..30fa5bc37fa 100644 --- a/docs/CMake.rst +++ b/docs/CMake.rst @@ -582,6 +582,9 @@ LLVM-specific variables If enabled, the compiler version check will only warn when using a toolchain which is about to be deprecated, instead of emitting an error. +**LLVM_USE_NEWPM**:BOOL + If enabled, use the experimental new pass manager. + CMake Caches ============