]> granicus.if.org Git - clang/commitdiff
Attach location info with llvm.dbg.declare.
authorDevang Patel <dpatel@apple.com>
Tue, 10 Nov 2009 23:07:24 +0000 (23:07 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 10 Nov 2009 23:07:24 +0000 (23:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86750 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index e2da3998c80b53e38d9a0746eadeaec490f3bdc8..ce43d4f38a6625c7e95e9ec03dd7a8dd549e4134 100644 (file)
@@ -941,6 +941,7 @@ void CGDebugInfo::EmitFunctionStart(const char *Name, QualType FnType,
 
   // Push function on region stack.
   RegionStack.push_back(SP);
+  EmitStopPoint(Fn, Builder);
 }
 
 
@@ -1165,7 +1166,9 @@ void CGDebugInfo::EmitDeclare(const VarDecl *Decl, unsigned Tag,
     DebugFactory.CreateVariable(Tag, RegionStack.back(),Decl->getNameAsString(),
                                 Unit, Line, Ty);
   // Insert an llvm.dbg.declare into the current block.
-  DebugFactory.InsertDeclare(Storage, D, Builder.GetInsertBlock());
+  llvm::Instruction *Call = 
+    DebugFactory.InsertDeclare(Storage, D, Builder.GetInsertBlock());
+  Builder.SetDebugLocation(Call);
 }
 
 /// EmitDeclare - Emit local variable declaration debug info.