aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorSteven Wu <stevenwu@apple.com>2015-07-17 20:09:56 +0000
committerSteven Wu <stevenwu@apple.com>2015-07-17 20:09:56 +0000
commit546a19628bc0d1e1e6b2f50d029df4b08e64dfa5 (patch)
treede33d42a65db7410c59f7987a5f2ff2c873eb8db /clang/lib/CodeGen/BackendUtil.cpp
parent76c2f2c9dae885fd51971ba8d3b9709355adeade (diff)
downloadllvm-546a19628bc0d1e1e6b2f50d029df4b08e64dfa5.zip
llvm-546a19628bc0d1e1e6b2f50d029df4b08e64dfa5.tar.gz
llvm-546a19628bc0d1e1e6b2f50d029df4b08e64dfa5.tar.bz2
Fix -save-temp when using objc-arc, sanitizer and profiling
Currently, -save-temp will cause ObjCARC optimization to be dropped, sanitizer pass to run early in the pipeline, and profiling instrumentation to run twice. Fix the issue by properly disable all passes in the optimization pipeline when generating bitcode output and parse some of the Language Options even when the input is bitcode so the passes can be setup correctly. llvm-svn: 242565
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index afcb9e5..5754bb6 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -272,6 +272,9 @@ static void addSymbolRewriterPass(const CodeGenOptions &Opts,
}
void EmitAssemblyHelper::CreatePasses() {
+ if (CodeGenOpts.DisableLLVMPasses)
+ return;
+
unsigned OptLevel = CodeGenOpts.OptimizationLevel;
CodeGenOptions::InliningMethod Inlining = CodeGenOpts.getInlining();