Skip to content

Commit

Permalink
CMake option to allow enabling experimental new pass manager by default
Browse files Browse the repository at this point in the history
This CMake flag allows setting the default value for the
-f[no]-experimental-new-pass-manager flag.

Differential Revision: https://reviews.llvm.org/D44330

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329366 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
petrhosek committed Apr 6, 2018
1 parent 80c7cef commit 451943a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ set(ENABLE_LINKER_BUILD_ID OFF CACHE BOOL "pass --build-id to ld")
set(ENABLE_X86_RELAX_RELOCATIONS OFF CACHE BOOL
"enable x86 relax relocations by default")

set(ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER FALSE CACHE BOOL
"Enable the experimental new pass manager by default.")

# TODO: verify the values against LangStandards.def?
set(CLANG_DEFAULT_STD_C "" CACHE STRING
"Default standard to use for C/ObjC code (IDENT from LangStandards.def, empty for platform default)")
Expand Down
3 changes: 3 additions & 0 deletions include/clang/Config/config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
/* enable x86 relax relocations by default */
#cmakedefine01 ENABLE_X86_RELAX_RELOCATIONS

/* Enable the experimental new pass manager by default */
#cmakedefine01 ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER

/* Enable each functionality of modules */
#cmakedefine01 CLANG_ENABLE_ARCMT
#cmakedefine01 CLANG_ENABLE_OBJC_REWRITER
Expand Down
2 changes: 1 addition & 1 deletion lib/Driver/ToolChains/CommonArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ void tools::AddGoldPlugin(const ToolChain &ToolChain, const ArgList &Args,
// Need this flag to turn on new pass manager via Gold plugin.
if (Args.hasFlag(options::OPT_fexperimental_new_pass_manager,
options::OPT_fno_experimental_new_pass_manager,
/* Default */ false)) {
/* Default */ ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER)) {
CmdArgs.push_back("-plugin-opt=new-pass-manager");
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Frontend/CompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,

Opts.ExperimentalNewPassManager = Args.hasFlag(
OPT_fexperimental_new_pass_manager, OPT_fno_experimental_new_pass_manager,
/* Default */ false);
/* Default */ ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER);

Opts.DebugPassManager =
Args.hasFlag(OPT_fdebug_pass_manager, OPT_fno_debug_pass_manager,
Expand Down

0 comments on commit 451943a

Please sign in to comment.