summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/tools/clang-cc/Backend.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/tools/clang-cc/Backend.cpp b/clang/tools/clang-cc/Backend.cpp
index 58ecedb7f2c..3b3be31866e 100644
--- a/clang/tools/clang-cc/Backend.cpp
+++ b/clang/tools/clang-cc/Backend.cpp
@@ -425,6 +425,12 @@ ASTConsumer *clang::CreateBackendConsumer(BackendAction Action,
const CompileOptions &CompileOpts,
const std::string& InFile,
const std::string& OutFile) {
+ // FIXME: If optimizing, disable all debug info generation. The LLVM
+ // optimizer and backend is not ready to handle it when optimizations
+ // are enabled.
+ if (CompileOpts.OptimizationLevel > 0)
+ const_cast<CompileOptions&>(CompileOpts).DebugInfo = false;
+
return new BackendConsumer(Action, Diags, LangOpts, CompileOpts,
InFile, OutFile);
}
OpenPOWER on IntegriCloud