[llvm-commits] [llvm] r98986 - in /llvm/trunk: lib/VMCore/Verifier.cpp test/DebugInfo/2010-03-19-DbgDeclare.ll
Devang Patel
dpatel at apple.com
Fri Mar 19 14:06:25 PDT 2010
Author: dpatel
Date: Fri Mar 19 16:06:24 2010
New Revision: 98986
URL: http://llvm.org/viewvc/llvm-project?rev=98986&view=rev
Log:
call void @llvm.dbg.declare(metadata !{i32* null}, metadata !1)
is valid, but not useful, when variable identified by !1 is optimized away by the optimizer.
Added:
llvm/trunk/test/DebugInfo/2010-03-19-DbgDeclare.ll
Modified:
llvm/trunk/lib/VMCore/Verifier.cpp
Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=98986&r1=98985&r2=98986&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Fri Mar 19 16:06:24 2010
@@ -1623,10 +1623,6 @@
MDNode *MD = cast<MDNode>(CI.getOperand(1));
Assert1(MD->getNumOperands() == 1,
"invalid llvm.dbg.declare intrinsic call 2", &CI);
- if (MD->getOperand(0))
- if (Constant *C = dyn_cast<Constant>(MD->getOperand(0)))
- Assert1(C && !isa<ConstantPointerNull>(C),
- "invalid llvm.dbg.declare intrinsic call 3", &CI);
} break;
case Intrinsic::memcpy:
case Intrinsic::memmove:
Added: llvm/trunk/test/DebugInfo/2010-03-19-DbgDeclare.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2010-03-19-DbgDeclare.ll?rev=98986&view=auto
==============================================================================
--- llvm/trunk/test/DebugInfo/2010-03-19-DbgDeclare.ll (added)
+++ llvm/trunk/test/DebugInfo/2010-03-19-DbgDeclare.ll Fri Mar 19 16:06:24 2010
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | opt -verify -disable-output
+
+define void @Foo(i32 %a, i32 %b) {
+entry:
+ call void @llvm.dbg.declare(metadata !{i32* null}, metadata !1)
+ ret void
+}
+
+!0 = metadata !{i32 662302, i32 26, metadata !1, null}
+!1 = metadata !{i32 4, metadata !"foo"}
+
+declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
More information about the llvm-commits
mailing list