aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2009-01-22 21:35:57 +0000
committerGabor Greif <ggreif@gmail.com>2009-01-22 21:35:57 +0000
commitedc4d69917df7dc34543adf719d5c93249fd5e27 (patch)
tree5da6a083d7eff2b5ba22d563b1a817caf42abcaf /lib/Analysis
parent1592e5b75a4e919c463914acdb4cab0a6a6ebd53 (diff)
downloadexternal_llvm-edc4d69917df7dc34543adf719d5c93249fd5e27.zip
external_llvm-edc4d69917df7dc34543adf719d5c93249fd5e27.tar.gz
external_llvm-edc4d69917df7dc34543adf719d5c93249fd5e27.tar.bz2
introduce a useful abstraction to find out if a Use is in the call position of an instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62788 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/IPA/CallGraph.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp
index c8f1d92..ea7d7fe 100644
--- a/lib/Analysis/IPA/CallGraph.cpp
+++ b/lib/Analysis/IPA/CallGraph.cpp
@@ -126,7 +126,8 @@ private:
// Loop over all of the users of the function, looking for non-call uses.
for (Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E; ++I)
- if ((!isa<CallInst>(*I) && !isa<InvokeInst>(*I)) || I.getOperandNo()) {
+ if ((!isa<CallInst>(I) && !isa<InvokeInst>(I))
+ || !CallSite(cast<Instruction>(I)).isCallee(I)) {
// Not a call, or being used as a parameter rather than as the callee.
ExternalCallingNode->addCalledFunction(CallSite(), Node);
break;