summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-10-01 22:08:58 +0000
committerMike Stump <mrs@apple.com>2009-10-01 22:08:58 +0000
commit70cb67fcf4afa1cf285dabf394f52031814142be (patch)
treeb8507afb4074a4928bff2e429b4be3ed6ffe0cad /llvm/lib
parent9a051a59228af28662e7d796ae8323616bc01a23 (diff)
downloadbcm5719-llvm-70cb67fcf4afa1cf285dabf394f52031814142be.tar.gz
bcm5719-llvm-70cb67fcf4afa1cf285dabf394f52031814142be.zip
Expand api out in the usual inserter way, though, I do have a
question, can we get rid of the BasicBlock versions of all inserters and use Head == 0 to indicate the old case when GetInsertBlock == 0? llvm-svn: 83216
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/DebugInfo.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp
index 6b13e74a739..1d6e3a6e44e 100644
--- a/llvm/lib/Analysis/DebugInfo.cpp
+++ b/llvm/lib/Analysis/DebugInfo.cpp
@@ -933,15 +933,29 @@ void DIFactory::InsertRegionEnd(DIDescriptor D, BasicBlock *BB) {
}
/// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call.
-void DIFactory::InsertDeclare(Value *Storage, DIVariable D, BasicBlock *BB) {
+void DIFactory::InsertDeclare(Value *Storage, DIVariable D,
+ Instruction *InsertBefore) {
// Cast the storage to a {}* for the call to llvm.dbg.declare.
- Storage = new BitCastInst(Storage, EmptyStructPtr, "", BB);
+ Storage = new BitCastInst(Storage, EmptyStructPtr, "", InsertBefore);
if (!DeclareFn)
DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare);
Value *Args[] = { Storage, D.getNode() };
- CallInst::Create(DeclareFn, Args, Args+2, "", BB);
+ CallInst::Create(DeclareFn, Args, Args+2, "", InsertBefore);
+}
+
+/// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call.
+void DIFactory::InsertDeclare(Value *Storage, DIVariable D,
+ BasicBlock *InsertAtEnd) {
+ // Cast the storage to a {}* for the call to llvm.dbg.declare.
+ Storage = new BitCastInst(Storage, EmptyStructPtr, "", InsertAtEnd);
+
+ if (!DeclareFn)
+ DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare);
+
+ Value *Args[] = { Storage, D.getNode() };
+ CallInst::Create(DeclareFn, Args, Args+2, "", InsertAtEnd);
}
OpenPOWER on IntegriCloud