diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2012-06-28 22:57:00 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2012-06-28 22:57:00 +0000 |
commit | 917f97c580c3ba16faa291884d6600cf2b275c99 (patch) | |
tree | 93c79c87c80747fa76c53cd30ca13355d5044cd4 /lib/VMCore/Verifier.cpp | |
parent | 7f71f5f6b8eaea342306b0cddb04e273a8562db6 (diff) |
make the verifier accept @llvm.donothing as the only intrinsic that can be invoked
While at it, merge 2 tests and FileCheckize them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159388 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Verifier.cpp')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 9a9b0b7e0b..5d51f4164a 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -1636,9 +1636,11 @@ void Verifier::visitInstruction(Instruction &I) { if (Function *F = dyn_cast<Function>(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<CallInst>(I) ? e-1 : 0), "Cannot take the address of an intrinsic!", &I); + Assert1(!F->isIntrinsic() || isa<CallInst>(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<BasicBlock>(I.getOperand(i))) { |