summaryrefslogtreecommitdiffstats
path: root/clang/Driver/Backend.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-10-29 08:50:02 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-10-29 08:50:02 +0000
commitb3a36cf86acbcc4b3155622b246eb31447c92d50 (patch)
tree69126dc83820d3e6b30b748492e960b687fb6ce1 /clang/Driver/Backend.cpp
parentce3ccc1ea0aae3e18a706e89fd836fa06f5c2a37 (diff)
downloadbcm5719-llvm-b3a36cf86acbcc4b3155622b246eb31447c92d50.tar.gz
bcm5719-llvm-b3a36cf86acbcc4b3155622b246eb31447c92d50.zip
Workaround an LLVM bug where inlining functions with debug info breaks
code generation. - For now, disable running the always inliner pass (at -O0) if we are also generating debug information. llvm-svn: 58376
Diffstat (limited to 'clang/Driver/Backend.cpp')
-rw-r--r--clang/Driver/Backend.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/Driver/Backend.cpp b/clang/Driver/Backend.cpp
index fe26f1170ce..dbe46fcf2f1 100644
--- a/clang/Driver/Backend.cpp
+++ b/clang/Driver/Backend.cpp
@@ -46,6 +46,8 @@ namespace {
CompileOptions CompileOpts;
const std::string &InputFile;
std::string OutputFile;
+ bool GenerateDebugInfo;
+
llvm::OwningPtr<CodeGenerator> Gen;
llvm::Module *TheModule;
@@ -76,11 +78,12 @@ namespace {
BackendConsumer(BackendAction action, Diagnostic &Diags,
const LangOptions &Features, const CompileOptions &compopts,
const std::string& infile, const std::string& outfile,
- bool GenerateDebugInfo) :
+ bool debug) :
Action(action),
CompileOpts(compopts),
InputFile(infile),
OutputFile(outfile),
+ GenerateDebugInfo(debug),
Gen(CreateLLVMCodeGen(Diags, Features, InputFile, GenerateDebugInfo)),
TheModule(0), TheTargetData(0), AsmOutStream(0), ModuleProvider(0),
CodeGenPasses(0), PerModulePasses(0), PerFunctionPasses(0) {}
@@ -304,7 +307,10 @@ void BackendConsumer::CreatePasses() {
if (CompileOpts.OptimizationLevel > 1 && CompileOpts.UnitAtATime)
PM->add(createConstantMergePass()); // Merge dup global constants
} else {
- PM->add(createAlwaysInlinerPass());
+ // FIXME: Remove this once LLVM doesn't break when inlining
+ // functions with debug info.
+ if (!GenerateDebugInfo)
+ PM->add(createAlwaysInlinerPass());
}
}
OpenPOWER on IntegriCloud