summaryrefslogtreecommitdiffstats
path: root/clang/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
commitb13eebe0cee4f0883c11bd98e2fe9be03a344c0a (patch)
treeeb201b7b3807a72d0c7d98ba633452a397003ad2 /clang/lib
parent664706916b5ce486cd109d51687dc05da95d104f (diff)
downloadbcm5719-llvm-b13eebe0cee4f0883c11bd98e2fe9be03a344c0a.tar.gz
bcm5719-llvm-b13eebe0cee4f0883c11bd98e2fe9be03a344c0a.zip
[NewPM] Add Clang cc1 flag -fdebug-pass-manager for printing debug information.
Differential Revision: https://reviews.llvm.org/D34790 llvm-svn: 306757
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp11
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp4
2 files changed, 11 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 2621f035f4e..67ccbcd63a0 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/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/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 7996da33adc..6b0a5f9d87a 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/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")
OpenPOWER on IntegriCloud