diff options
author | Gabor Greif <ggreif@gmail.com> | 2009-01-22 21:35:57 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2009-01-22 21:35:57 +0000 |
commit | f4013373cd9919fb7f4425ad549e4fdf0c875fba (patch) | |
tree | ca91eca70111f94b6a90c0122a063b49db4c37ae /llvm/lib/Analysis | |
parent | 8c5ffd07610476f5e7fd95fca8817e12c76584f4 (diff) | |
download | bcm5719-llvm-f4013373cd9919fb7f4425ad549e4fdf0c875fba.tar.gz bcm5719-llvm-f4013373cd9919fb7f4425ad549e4fdf0c875fba.zip |
introduce a useful abstraction to find out if a Use is in the call position of an instruction
llvm-svn: 62788
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/IPA/CallGraph.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp index c8f1d920658..ea7d7feb4cd 100644 --- a/llvm/lib/Analysis/IPA/CallGraph.cpp +++ b/llvm/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; |