[llvm-commits] CVS: poolalloc/lib/PoolAllocate/PoolAllocate.cpp

Chris Lattner lattner at cs.uiuc.edu
Sat Sep 20 14:11:01 PDT 2003


Changes in directory poolalloc/lib/PoolAllocate:

PoolAllocate.cpp updated: 1.21 -> 1.22

---
Log message:

Adjust to work with recent invoke changes.  This doesn't handle invoke yet, but
does at least compile now


---
Diffs of the changes:

Index: poolalloc/lib/PoolAllocate/PoolAllocate.cpp
diff -u poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.21 poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.22
--- poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.21	Thu Aug 21 11:05:04 2003
+++ poolalloc/lib/PoolAllocate/PoolAllocate.cpp	Sat Sep 20 14:10:11 2003
@@ -94,14 +94,15 @@
       if (CSI->isIndirectCall()) {
 	DSNode *DSN = CSI->getCalleeNode();
 	if (DSN->isIncomplete())
-	  std::cerr << "Incomplete node " << CSI->getCallInst();
+	  std::cerr << "Incomplete node: "
+                    << *CSI->getCallSite().getInstruction();
 	// assert(DSN->isGlobalNode());
 	const std::vector<GlobalValue*> &Callees = DSN->getGlobals();
 	if (Callees.size() > 0) {
 	  Function *firstCalledF = dyn_cast<Function>(*Callees.begin());
 	  FuncECs.addElement(firstCalledF);
 	  CallInstTargets.insert(std::pair<CallInst*,Function*>
-				 (&CSI->getCallInst(),
+				 (cast<CallInst>(CSI->getCallSite().getInstruction()),
 				  firstCalledF));
 	  if (Callees.size() > 1) {
 	    for (std::vector<GlobalValue*>::const_iterator CalleesI = 
@@ -110,11 +111,11 @@
 	      Function *calledF = dyn_cast<Function>(*CalleesI);
 	      FuncECs.unionSetsWith(firstCalledF, calledF);
 	      CallInstTargets.insert(std::pair<CallInst*,Function*>
-				     (&CSI->getCallInst(), calledF));
+				     (cast<CallInst>(CSI->getCallSite().getInstruction()), calledF));
 	    }
 	  }
 	} else {
-	  std::cerr << "No targets " << CSI->getCallInst();
+	  std::cerr << "No targets: " << *CSI->getCallSite().getInstruction();
 	}
       }
     }
@@ -234,7 +235,7 @@
   for (std::vector<DSCallSite>::iterator CSI = callSites.begin(),
          CSE = callSites.end(); CSI != CSE; ++CSI) {
     if (CSI->isIndirectCall()) {
-      CallInst &CI = CSI->getCallInst();
+      CallInst &CI = *cast<CallInst>(CSI->getCallSite().getInstruction());
       std::pair<std::multimap<CallInst*, Function*>::iterator,
         std::multimap<CallInst*, Function*>::iterator> Targets =
         CallInstTargets.equal_range(&CI);





More information about the llvm-commits mailing list