From 24a052124bca3a518c9b30fbc57fa54f76bfbc46 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Tue, 9 Sep 2008 13:44:24 +0000 Subject: [PATCH] Optimization suggested by Matthijs Kooijman. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55988 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/IPA/CallGraph.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp index d24373c9b55..1a65179c5aa 100644 --- a/lib/Analysis/IPA/CallGraph.cpp +++ b/lib/Analysis/IPA/CallGraph.cpp @@ -135,7 +135,8 @@ private: I != E && !isUsedExternally; ++I) { if (Instruction *Inst = dyn_cast(*I)) { CallSite CS = CallSite::get(Inst); - isUsedExternally = !CS.getInstruction() || CS.hasArgument(F); + // Not a call? Or F being passed as a parameter not as the callee? + isUsedExternally = !CS.getInstruction() || I.getOperandNo(); } else { // User is not a direct call! isUsedExternally = true; } -- 2.34.1