]> granicus.if.org Git - clang/commitdiff
for now, disable all debug info generation at -O1 and above. This mirrors
authorChris Lattner <sabre@nondot.org>
Thu, 12 Feb 2009 01:50:58 +0000 (01:50 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 12 Feb 2009 01:50:58 +0000 (01:50 +0000)
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

Driver/Backend.cpp

index 328f08087b02d69e62ff5cd301accf60d78e8b9a..a0e102af09fed4b23e4ceaabdbcfa422e3c6e97e 100644 (file)
@@ -369,6 +369,13 @@ ASTConsumer *clang::CreateBackendConsumer(BackendAction Action,
                                           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);  
 }