[llvm-commits] [see] CVS: llvm-poolalloc/lib/DSA/DataStructure.cpp Local.cpp

Andrew Lenharth alenhar2 at cs.uiuc.edu
Tue Mar 13 18:24:38 PDT 2007



Changes in directory llvm-poolalloc/lib/DSA:

DataStructure.cpp updated: 1.248.2.4.2.4 -> 1.248.2.4.2.5
Local.cpp updated: 1.158.2.4.2.7 -> 1.158.2.4.2.8
---
Log message:

assign a meta pool to all dsnodes

---
Diffs of the changes:  (+7 -27)

 DataStructure.cpp |   22 +++++-----------------
 Local.cpp         |   12 ++----------
 2 files changed, 7 insertions(+), 27 deletions(-)


Index: llvm-poolalloc/lib/DSA/DataStructure.cpp
diff -u llvm-poolalloc/lib/DSA/DataStructure.cpp:1.248.2.4.2.4 llvm-poolalloc/lib/DSA/DataStructure.cpp:1.248.2.4.2.5
--- llvm-poolalloc/lib/DSA/DataStructure.cpp:1.248.2.4.2.4	Fri Mar  9 11:27:51 2007
+++ llvm-poolalloc/lib/DSA/DataStructure.cpp	Tue Mar 13 20:24:01 2007
@@ -128,7 +128,7 @@
 DSNode::DSNode(const Type *T, DSGraph *G)
   : NumReferrers(0), Size(0), ParentGraph(G), Ty(Type::VoidTy), NodeType(0)
 #ifdef LLVA_KERNEL
-  , MP(0)
+  , MP()
 #endif
  {
   // Add the type entry if it is specified...
@@ -198,11 +198,7 @@
   Size = 0;
   Ty = Type::VoidTy;
 #ifdef LLVA_KERNEL
-  MetaPool* MP = new MetaPool();
-  MP->merge(getMP());
-  MP->merge(To->getMP());
-  setMP(MP);
-  To->setMP(MP);
+  To->getMP()->merge(getMP());
 #endif
 
   // Remove this node from the parent graph's Nodes list.
@@ -265,7 +261,7 @@
     DestNode->Size = 1;
     DestNode->Globals.swap(Globals);
 #ifdef LLVA_KERNEL
-    DestNode->setMP(getMP());
+    DestNode->getMP()->merge(getMP());
 #endif
     
 #if JTC
@@ -866,11 +862,7 @@
 #endif
   }
 #ifdef LLVA_KERNEL
-  MetaPool* MP = new MetaPool();
-  MP->merge(CurNodeH.getNode()->getMP());
-  MP->merge(NH.getNode()->getMP());
-  CurNodeH.getNode()->setMP(MP);
-  NH.getNode()->setMP(MP);
+  NH.getNode()->getMP()->merge(CurNodeH.getNode()->getMP());
 #endif  
   // Merge the type entries of the two nodes together...
   if (NH.getNode()->Ty != Type::VoidTy)
@@ -1193,11 +1185,7 @@
 
 
 #ifdef LLVA_KERNEL
-  MetaPool* MP = new MetaPool();
-  MP->merge(NH.getNode()->getMP());
-  MP->merge(SrcNH.getNode()->getMP());
-  NH.getNode()->setMP(MP);
-  SrcNH.getNode()->setMP(MP);
+  SrcNH.getNode()->getMP()->merge(NH.getNode()->getMP());
 #endif  
 
   // Next, recursively merge all outgoing links as necessary.  Note that


Index: llvm-poolalloc/lib/DSA/Local.cpp
diff -u llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.4.2.7 llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.4.2.8
--- llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.4.2.7	Tue Mar 13 13:48:36 2007
+++ llvm-poolalloc/lib/DSA/Local.cpp	Tue Mar 13 20:24:01 2007
@@ -350,10 +350,6 @@
 ///
 void GraphBuilder::handleAlloc(AllocationInst &AI, bool isHeap) {
   DSNode *N = createNode();
-#ifdef LLVA_KERNEL
-  MetaPool* MP = new MetaPool();
-  N->setMP(MP);
-#endif
   if (isHeap)
     N->setHeapNodeMarker();
   else
@@ -1158,8 +1154,7 @@
         if (AllocList.end() != std::find(AllocList.begin(), AllocList.end(), F->getName())) {
           DSNode* N = createNode()->setHeapNodeMarker()->setModifiedMarker();
           setDestTo(*CS.getInstruction(), N);
-          MetaPool* MP = new MetaPool(CS);
-          N->setMP(MP);
+          N->getMP()->addCallSite(CS);
           return;
         }
 
@@ -1317,10 +1312,7 @@
   // Get a node handle to the global node and merge the initializer into it.
   DSNodeHandle NH = getValueDest(*GV);
   MergeConstantInitIntoNode(NH, GV->getInitializer());
-  MetaPool* MP = new MetaPool(GV);
-  if (NH.getNode()->getMP())
-    MP->merge(NH.getNode()->getMP());
-  NH.getNode()->setMP(MP);
+  NH.getNode()->getMP()->addGlobal(GV);
 }
 
 






More information about the llvm-commits mailing list