From b324e66f4c2ad19df026505209ec609a63ca9692 Mon Sep 17 00:00:00 2001 From: Victor Hernandez Date: Fri, 15 Jan 2010 19:04:09 +0000 Subject: 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 --- llvm/lib/VMCore/Verifier.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'llvm/lib/VMCore/Verifier.cpp') 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(CI.getOperand(1))) - Assert1(C && !isa(C), - "invalid llvm.dbg.declare intrinsic call", &CI); + if (MDNode *MD = dyn_cast(CI.getOperand(1))) + if (Constant *C = dyn_cast(MD->getOperand(0))) + Assert1(C && !isa(C), + "invalid llvm.dbg.declare intrinsic call", &CI); break; case Intrinsic::memcpy: case Intrinsic::memmove: -- cgit v1.2.3