aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/clang-cc/Backend.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/clang-cc/Backend.cpp b/tools/clang-cc/Backend.cpp
index 58ecedb7f2..3b3be31866 100644
--- a/tools/clang-cc/Backend.cpp
+++ b/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);
}