Attach location info with llvm.dbg.declare.
llvm-svn: 86750
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index e2da399..ce43d4f 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -941,6 +941,7 @@
// Push function on region stack.
RegionStack.push_back(SP);
+ EmitStopPoint(Fn, Builder);
}
@@ -1165,7 +1166,9 @@
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.