summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Verifier.cpp
diff options
context:
space:
mode:
authorVictor Hernandez <vhernandez@apple.com>2010-01-15 19:04:09 +0000
committerVictor Hernandez <vhernandez@apple.com>2010-01-15 19:04:09 +0000
commitb324e66f4c2ad19df026505209ec609a63ca9692 (patch)
tree555a16a52dc90f8724557409e2800b9aab9d8e45 /llvm/lib/VMCore/Verifier.cpp
parentfb85dddba0be0a0cafd927b5510f1c00ed7fe976 (diff)
downloadbcm5719-llvm-b324e66f4c2ad19df026505209ec609a63ca9692.tar.gz
bcm5719-llvm-b324e66f4c2ad19df026505209ec609a63ca9692.zip
Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare. It also strips old llvm.dbg.declare intrinsics that did not pass metadata as the first argument. llvm-svn: 93531
Diffstat (limited to 'llvm/lib/VMCore/Verifier.cpp')
-rw-r--r--llvm/lib/VMCore/Verifier.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp
index 66e2a670252..ec475e47297 100644
--- a/llvm/lib/VMCore/Verifier.cpp
+++ b/llvm/lib/VMCore/Verifier.cpp
@@ -1590,9 +1590,10 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
default:
break;
case Intrinsic::dbg_declare: // llvm.dbg.declare
- if (Constant *C = dyn_cast<Constant>(CI.getOperand(1)))
- Assert1(C && !isa<ConstantPointerNull>(C),
- "invalid llvm.dbg.declare intrinsic call", &CI);
+ if (MDNode *MD = dyn_cast<MDNode>(CI.getOperand(1)))
+ if (Constant *C = dyn_cast<Constant>(MD->getOperand(0)))
+ Assert1(C && !isa<ConstantPointerNull>(C),
+ "invalid llvm.dbg.declare intrinsic call", &CI);
break;
case Intrinsic::memcpy:
case Intrinsic::memmove:
OpenPOWER on IntegriCloud