]> granicus.if.org Git - clang/commitdiff
Preserve type info for local variables in optimized builds.
authorDevang Patel <dpatel@apple.com>
Sat, 5 Jun 2010 01:14:40 +0000 (01:14 +0000)
committerDevang Patel <dpatel@apple.com>
Sat, 5 Jun 2010 01:14:40 +0000 (01:14 +0000)
llvm-gcc enabled this couple of weeks ago.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105516 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index c9bcb1b7e0437f5f118903c7470d5f9f41ef3d2e..6025e09e7a26cb707887f2514346a33049959445 100644 (file)
@@ -1477,7 +1477,7 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag,
   llvm::DIVariable D =
     DebugFactory.CreateVariable(Tag, llvm::DIDescriptor(RegionStack.back()),
                                 VD->getName(),
-                                Unit, Line, Ty);
+                                Unit, Line, Ty, CGM.getLangOptions().Optimize);
   // Insert an llvm.dbg.declare into the current block.
   llvm::Instruction *Call =
     DebugFactory.InsertDeclare(Storage, D, Builder.GetInsertBlock());