From: Daniel Dunbar Date: Mon, 13 Apr 2009 18:03:39 +0000 (+0000) Subject: Revert 68936, LLVM still isn't ready to handle debug info + optimization. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5c71e596602b5bca64b75b36c71943bb62d278f2;p=clang Revert 68936, LLVM still isn't ready to handle debug info + optimization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68972 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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(CompileOpts).DebugInfo = false; + return new BackendConsumer(Action, Diags, LangOpts, CompileOpts, InFile, OutFile); }