From 05e7c6d29c65c43245c49cdbde10dba8270fa204 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 12 Feb 2009 01:50:58 +0000 Subject: [PATCH] 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 --- Driver/Backend.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Driver/Backend.cpp b/Driver/Backend.cpp index 328f08087b..a0e102af09 100644 --- a/Driver/Backend.cpp +++ b/Driver/Backend.cpp @@ -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); } -- 2.40.0