simplify
authorGabor Greif <ggreif@gmail.com>
Wed, 28 Jul 2010 15:31:37 +0000 (15:31 +0000)
committerGabor Greif <ggreif@gmail.com>
Wed, 28 Jul 2010 15:31:37 +0000 (15:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109585 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/AliasAnalysisEvaluator.cpp

index 8bd4b328911a089d66580b9461b29c9c09fb7193..9ecdf57e31acd157166340c1b1dc20020b3b8106 100644 (file)
@@ -126,8 +126,7 @@ bool AAEval::runOnFunction(Function &F) {
     if (I->getType()->isPointerTy()) // Add all pointer instructions.
       Pointers.insert(&*I);
     Instruction &Inst = *I;
-    CallSite CS = CallSite::get(&Inst);
-    if (CS) {
+    if (CallSite CS = cast<Value>(&Inst)) {
       Value *Callee = CS.getCalledValue();
       // Skip actual functions for direct function calls.
       if (!isa<Function>(Callee) && isInterestingPointer(Callee))
@@ -137,6 +136,7 @@ bool AAEval::runOnFunction(Function &F) {
            AI != AE; ++AI)
         if (isInterestingPointer(*AI))
           Pointers.insert(*AI);
+      CallSites.insert(CS);
     } else {
       // Consider all operands.
       for (Instruction::op_iterator OI = Inst.op_begin(), OE = Inst.op_end();
@@ -144,8 +144,6 @@ bool AAEval::runOnFunction(Function &F) {
         if (isInterestingPointer(*OI))
           Pointers.insert(*OI);
     }
-
-    if (CS.getInstruction()) CallSites.insert(CS);
   }
 
   if (PrintNoAlias || PrintMayAlias || PrintMustAlias ||