Do not include the Function* for direct call/invoke instructions in the
authorChris Lattner <sabre@nondot.org>
Thu, 17 Mar 2005 20:25:04 +0000 (20:25 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 17 Mar 2005 20:25:04 +0000 (20:25 +0000)
alias evaluation.  Clients really don't care.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20664 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/AliasAnalysisEvaluator.cpp

index 7c8ccb6c62f818ed0655a29dad362e636f13e31f..1b3daba0ab4187435340d92b357dbedaf0b071f2 100644 (file)
@@ -109,7 +109,12 @@ bool AAEval::runOnFunction(Function &F) {
   for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) {
     if (isa<PointerType>(I->getType())) // Add all pointer instructions
       Pointers.insert(&*I);
-    for (User::op_iterator OI = (*I).op_begin(); OI != (*I).op_end(); ++OI)
+    Instruction &Inst = *I;
+    User::op_iterator OI = Inst.op_begin();
+    if ((isa<InvokeInst>(Inst) || isa<CallInst>(Inst)) &&
+        isa<Function>(Inst.getOperand(0)))
+      ++OI;  // Skip actual functions for direct function calls.
+    for (; OI != Inst.op_end(); ++OI)
       if (isa<PointerType>((*OI)->getType()))
         Pointers.insert(*OI);