From: Devang Patel Date: Thu, 5 Nov 2009 19:13:29 +0000 (+0000) Subject: Enable debug info for global variables at -O1+ X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e09db7aa9485a28455efe9759cf1408c1385e18;p=clang Enable debug info for global variables at -O1+ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86156 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 1b01e1537b..714dde059b 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1362,13 +1362,6 @@ void CGDebugInfo::EmitDeclareOfArgVariable(const VarDecl *Decl, llvm::Value *AI, void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var, const VarDecl *Decl) { - // Do not emit variable debug information while generating optimized code. - // The llvm optimizer and code generator are not yet ready to support - // optimized code debugging. - const CompileOptions &CO = M->getCompileOpts(); - if (CO.OptimizationLevel) - return; - // Create global variable debug descriptor. llvm::DICompileUnit Unit = getOrCreateCompileUnit(Decl->getLocation()); SourceManager &SM = M->getContext().getSourceManager();