diff options
author | Duncan Sands <baldrick@free.fr> | 2012-09-26 17:16:01 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2012-09-26 17:16:01 +0000 |
commit | 44401b7c80f334b4bbe5537fd28ed9da471e2c27 (patch) | |
tree | a551d75d22fd9d5fe2abb2802e66008e74295b8a /lib/Analysis/IPA/CallGraph.cpp | |
parent | 696e06e4535e4e5125020b6cb5a14935ea06e6a2 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164707 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA/CallGraph.cpp')
-rw-r--r-- | lib/Analysis/IPA/CallGraph.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp index 17631ddb30..dec0eced27 100644 --- a/lib/Analysis/IPA/CallGraph.cpp +++ b/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)); } } } |