]> granicus.if.org Git - clang/commitdiff
Revert 68936, LLVM still isn't ready to handle debug info + optimization.
authorDaniel Dunbar <daniel@zuster.org>
Mon, 13 Apr 2009 18:03:39 +0000 (18:03 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 13 Apr 2009 18:03:39 +0000 (18:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68972 91177308-0d34-0410-b5e6-96231b3b80d8

tools/clang-cc/Backend.cpp

index 58ecedb7f2c1216a176946e104bcf97807142e98..3b3be31866ee2c386d5304123f8fcd94171f523e 100644 (file)
@@ -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);  
 }