summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorTim Shen <timshen91@gmail.com>2017-06-29 23:10:13 +0000
committerTim Shen <timshen91@gmail.com>2017-06-29 23:10:13 +0000
commitae1ed388cd6e265fdbb773a11f6797dee9d16fd6 (patch)
tree76f93d2bf716d9ac0627059a7417a40adb989e41 /lib
parente4158c49f4b27bfcf3efd2290483f2479cfacafa (diff)
[NewPM] Add Clang cc1 flag -fdebug-pass-manager for printing debug information.
Differential Revision: https://reviews.llvm.org/D34790 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306757 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/BackendUtil.cpp11
-rw-r--r--lib/Frontend/CompilerInvocation.cpp4
2 files changed, 11 insertions, 4 deletions
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp
index 2621f035f4..67ccbcd63a 100644
--- a/lib/CodeGen/BackendUtil.cpp
+++ b/lib/CodeGen/BackendUtil.cpp
@@ -879,7 +879,7 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
PB.registerLoopAnalyses(LAM);
PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);
- ModulePassManager MPM;
+ ModulePassManager MPM(CodeGenOpts.DebugPassManager);
if (!CodeGenOpts.DisableLLVMPasses) {
bool IsThinLTO = CodeGenOpts.EmitSummaryIndex;
@@ -897,12 +897,15 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
PassBuilder::OptimizationLevel Level = mapToLevel(CodeGenOpts);
if (IsThinLTO) {
- MPM = PB.buildThinLTOPreLinkDefaultPipeline(Level);
+ MPM = PB.buildThinLTOPreLinkDefaultPipeline(
+ Level, CodeGenOpts.DebugPassManager);
MPM.addPass(NameAnonGlobalPass());
} else if (IsLTO) {
- MPM = PB.buildLTOPreLinkDefaultPipeline(Level);
+ MPM = PB.buildLTOPreLinkDefaultPipeline(Level,
+ CodeGenOpts.DebugPassManager);
} else {
- MPM = PB.buildPerModuleDefaultPipeline(Level);
+ MPM = PB.buildPerModuleDefaultPipeline(Level,
+ CodeGenOpts.DebugPassManager);
}
}
}
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index 7996da33ad..6b0a5f9d87 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -476,6 +476,10 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
OPT_fexperimental_new_pass_manager, OPT_fno_experimental_new_pass_manager,
/* Default */ false);
+ Opts.DebugPassManager =
+ Args.hasFlag(OPT_fdebug_pass_manager, OPT_fno_debug_pass_manager,
+ /* Default */ false);
+
if (Arg *A = Args.getLastArg(OPT_fveclib)) {
StringRef Name = A->getValue();
if (Name == "Accelerate")