[llvm-commits] [poolalloc] r48901 - /poolalloc/trunk/include/poolalloc/PoolAllocate.h

John Criswell criswell at uiuc.edu
Thu Mar 27 15:29:38 PDT 2008


Author: criswell
Date: Thu Mar 27 17:29:38 2008
New Revision: 48901

URL: http://llvm.org/viewvc/llvm-project?rev=48901&view=rev
Log:
Got PoolAllocSimple to work with SAFECode.

Modified:
    poolalloc/trunk/include/poolalloc/PoolAllocate.h

Modified: poolalloc/trunk/include/poolalloc/PoolAllocate.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/poolalloc/PoolAllocate.h?rev=48901&r1=48900&r2=48901&view=diff

==============================================================================
--- poolalloc/trunk/include/poolalloc/PoolAllocate.h (original)
+++ poolalloc/trunk/include/poolalloc/PoolAllocate.h Thu Mar 27 17:29:38 2008
@@ -120,10 +120,8 @@
   bool PassAllArguments;
 
   Module *CurModule;
-  EquivClassGraphs *ECGraphs;
   CallTargetFinder* CTF;
   
-  std::map<Function*, PA::FuncInfo> FunctionInfo;
   std::map<Function*, Function*> CloneToOrigMap;
 public:
 
@@ -146,6 +144,10 @@
   /// node.
   std::map<const DSNode*, Value*> GlobalNodes;
 
+protected:
+  std::map<Function*, PA::FuncInfo> FunctionInfo;
+  EquivClassGraphs *ECGraphs;
+
  public:
   static char ID;
 #ifdef SAFECODE  
@@ -216,6 +218,13 @@
 #endif
   }
 
+  virtual Value * getGlobalPool (const DSNode * Node) {
+    std::map<const DSNode *, Value *>::iterator I = GlobalNodes.find (Node);
+    if (I == GlobalNodes.end())
+      return 0;
+    else
+      return I->second;
+  }
 protected:
   
   /// AddPoolPrototypes - Add prototypes for the pool functions to the
@@ -314,7 +323,11 @@
   GlobalVariable *CreateGlobalPool(unsigned RecSize, unsigned Align,
                                    Instruction *IPHint, Module& M);
   void ProcessFunctionBodySimple(Function& F);
-};
+
+  virtual Value * getGlobalPool (const DSNode * Node) {
+    return TheGlobalPool;
+  }
+  };
 }
 
 #endif





More information about the llvm-commits mailing list