From: Devang Patel Date: Tue, 10 Nov 2009 23:07:24 +0000 (+0000) Subject: Attach location info with llvm.dbg.declare. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a0203800ea2f93b2ce00fae24d6deac57617268d;p=clang Attach location info with llvm.dbg.declare. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86750 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index e2da3998c8..ce43d4f38a 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -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.