for now, disable all debug info generation at -O1 and above. This mirrors
similar logic in llvm-gcc and will hopefully be fixed soon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64349 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/Backend.cpp b/Driver/Backend.cpp
index 328f080..a0e102a 100644
--- a/Driver/Backend.cpp
+++ b/Driver/Backend.cpp
@@ -369,6 +369,13 @@
const std::string& InFile,
const std::string& OutFile,
bool GenerateDebugInfo) {
+ // 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)
+ GenerateDebugInfo = false;
+
+
return new BackendConsumer(Action, Diags, Features, CompileOpts,
InFile, OutFile, GenerateDebugInfo);
}