summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/IPA/CallGraph.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2012-09-26 17:16:01 +0000
committerDuncan Sands <baldrick@free.fr>2012-09-26 17:16:01 +0000
commit8598a0ec807854a41119b38477402cc1172d2bc2 (patch)
treecb93e034c531036dd6966994d0c9dc56958a111b /llvm/lib/Analysis/IPA/CallGraph.cpp
parent17df40d484c650245b67a7e3fa2ae91354f5ea26 (diff)
downloadbcm5719-llvm-8598a0ec807854a41119b38477402cc1172d2bc2.tar.gz
bcm5719-llvm-8598a0ec807854a41119b38477402cc1172d2bc2.zip
Now that invoke of an intrinsic is possible (for the llvm.do.nothing intrinsic)
teach the callgraph logic to not create callgraph edges to intrinsics for invoke instructions; it already skips this for call instructions. Fixes PR13903. llvm-svn: 164707
Diffstat (limited to 'llvm/lib/Analysis/IPA/CallGraph.cpp')
-rw-r--r--llvm/lib/Analysis/IPA/CallGraph.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp
index 17631ddb305..dec0eced278 100644
--- a/llvm/lib/Analysis/IPA/CallGraph.cpp
+++ b/llvm/lib/Analysis/IPA/CallGraph.cpp
@@ -141,12 +141,13 @@ private:
for (BasicBlock::iterator II = BB->begin(), IE = BB->end();
II != IE; ++II) {
CallSite CS(cast<Value>(II));
- if (CS && !isa<IntrinsicInst>(II)) {
+ if (CS) {
const Function *Callee = CS.getCalledFunction();
- if (Callee)
- Node->addCalledFunction(CS, getOrInsertFunction(Callee));
- else
+ if (!Callee)
+ // Indirect calls of intrinsics are not allowed so no need to check.
Node->addCalledFunction(CS, CallsExternalNode);
+ else if (!Callee->isIntrinsic())
+ Node->addCalledFunction(CS, getOrInsertFunction(Callee));
}
}
}
OpenPOWER on IntegriCloud