summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Verifier.cpp
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-06-25 17:11:47 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-06-25 17:11:47 +0000
commit07594cba7c91a7bd498925041a73ea5eb7fd0ec2 (patch)
tree133323e55443ecd1941ae7faa1c2d56ac9ff4a32 /llvm/lib/VMCore/Verifier.cpp
parent9ecc8761bceabd5b6392d3473c1bf181160cb2a3 (diff)
downloadbcm5719-llvm-07594cba7c91a7bd498925041a73ea5eb7fd0ec2.tar.gz
bcm5719-llvm-07594cba7c91a7bd498925041a73ea5eb7fd0ec2.zip
improve optimization of invoke instructions:
- simplifycfg: invoke undef/null -> unreachable - instcombine: invoke new -> invoke expect(0, 0) (an arbitrary NOOP intrinsic; only done if the allocated memory is unused, of course) - verifier: allow invoke of intrinsics (to make the previous step work) llvm-svn: 159146
Diffstat (limited to 'llvm/lib/VMCore/Verifier.cpp')
-rw-r--r--llvm/lib/VMCore/Verifier.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp
index 477b81dc67f..9a9b0b7e0b3 100644
--- a/llvm/lib/VMCore/Verifier.cpp
+++ b/llvm/lib/VMCore/Verifier.cpp
@@ -1636,7 +1636,8 @@ 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.
- Assert1(!F->isIntrinsic() || (i + 1 == e && isa<CallInst>(I)),
+ CallSite CS(&I);
+ Assert1(!F->isIntrinsic() || (CS && i == (CS.isCall() ? e-1 : 2)),
"Cannot take the address of an intrinsic!", &I);
Assert1(F->getParent() == Mod, "Referencing function in another module!",
&I);
OpenPOWER on IntegriCloud