From 2f49284f12aef1f8e3d0564cfed37b742b84b7ff Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Thu, 28 Jun 2012 22:57:00 +0000 Subject: make the verifier accept @llvm.donothing as the only intrinsic that can be invoked While at it, merge 2 tests and FileCheckize them llvm-svn: 159388 --- llvm/lib/VMCore/Verifier.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp index 9a9b0b7e0b3..5d51f4164a4 100644 --- a/llvm/lib/VMCore/Verifier.cpp +++ b/llvm/lib/VMCore/Verifier.cpp @@ -1636,9 +1636,11 @@ void Verifier::visitInstruction(Instruction &I) { if (Function *F = dyn_cast(I.getOperand(i))) { // Check to make sure that the "address of" an intrinsic function is never // taken. - CallSite CS(&I); - Assert1(!F->isIntrinsic() || (CS && i == (CS.isCall() ? e-1 : 2)), + Assert1(!F->isIntrinsic() || i == (isa(I) ? e-1 : 0), "Cannot take the address of an intrinsic!", &I); + Assert1(!F->isIntrinsic() || isa(I) || + F->getIntrinsicID() == Intrinsic::donothing, + "Cannot invoke an intrinsinc other than donothing", &I); Assert1(F->getParent() == Mod, "Referencing function in another module!", &I); } else if (BasicBlock *OpBB = dyn_cast(I.getOperand(i))) { -- cgit v1.2.3