use Value* constructor of CallSite to create potentially improper site
authorGabor Greif <ggreif@gmail.com>
Wed, 28 Jul 2010 12:19:46 +0000 (12:19 +0000)
committerGabor Greif <ggreif@gmail.com>
Wed, 28 Jul 2010 12:19:46 +0000 (12:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109579 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/IPA/CallGraph.cpp

index 0e474e66682987a2d590143058842f499f9e5640..1af0055ce541151460e43daf4e5c428d59e12055 100644 (file)
@@ -145,8 +145,8 @@ private:
     for (Function::iterator BB = F->begin(), BBE = F->end(); BB != BBE; ++BB)
       for (BasicBlock::iterator II = BB->begin(), IE = BB->end();
            II != IE; ++II) {
-        CallSite CS = CallSite::get(II);
-        if (CS.getInstruction() && !isa<DbgInfoIntrinsic>(II)) {
+        CallSite CS(cast<Value>(II));
+        if (CS && !isa<DbgInfoIntrinsic>(II)) {
           const Function *Callee = CS.getCalledFunction();
           if (Callee)
             Node->addCalledFunction(CS, getOrInsertFunction(Callee));