[llvm-commits] [poolalloc] r48790 - in /poolalloc/trunk: include/poolalloc/PoolAllocate.h lib/PoolAllocate/PASimple.cpp

John Criswell criswell at uiuc.edu
Tue Mar 25 12:56:39 PDT 2008


Author: criswell
Date: Tue Mar 25 14:56:39 2008
New Revision: 48790

URL: http://llvm.org/viewvc/llvm-project?rev=48790&view=rev
Log:
Moved the class definition of PoolAllocateSimple into the publicly
accessbile PoolAllocate.h header file.  The SAFECode project will need to have
the class definition.

Modified:
    poolalloc/trunk/include/poolalloc/PoolAllocate.h
    poolalloc/trunk/lib/PoolAllocate/PASimple.cpp

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

==============================================================================
--- poolalloc/trunk/include/poolalloc/PoolAllocate.h (original)
+++ poolalloc/trunk/include/poolalloc/PoolAllocate.h Tue Mar 25 14:56:39 2008
@@ -300,6 +300,21 @@
   PoolAllocatePassAllPools() : PoolAllocate(true, (intptr_t) &ID) {}
 };
 
+/// PoolAllocateSimple - This class modifies the heap allocations so that they
+/// use the pool allocator run-time.  However, unlike PoolAllocatePassAllPools,
+/// it doesn't involve all of complex machinery of the original pool allocation
+/// implementation.
+class PoolAllocateSimple : public PoolAllocate {
+  GlobalValue* TheGlobalPool;
+public:
+  static char ID;
+  PoolAllocateSimple() : PoolAllocate(false, (intptr_t)&ID) {}
+  void getAnalysisUsage(AnalysisUsage &AU) const;
+  bool runOnModule(Module &M);
+  GlobalVariable *CreateGlobalPool(unsigned RecSize, unsigned Align,
+                                   Instruction *IPHint, Module& M);
+  void ProcessFunctionBodySimple(Function& F);
+};
 }
 
 #endif

Modified: poolalloc/trunk/lib/PoolAllocate/PASimple.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PASimple.cpp?rev=48790&r1=48789&r2=48790&view=diff

==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PASimple.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PASimple.cpp Tue Mar 25 14:56:39 2008
@@ -41,25 +41,11 @@
 using namespace llvm;
 using namespace PA;
 
-namespace {
-  class PoolAllocateSimple : public PoolAllocate {
-    GlobalValue* TheGlobalPool;
-  public:
-    static char ID;
-    PoolAllocateSimple() : PoolAllocate(false, (intptr_t)&ID) {}
-    void getAnalysisUsage(AnalysisUsage &AU) const;
-    bool runOnModule(Module &M);
-    GlobalVariable *CreateGlobalPool(unsigned RecSize, unsigned Align,
-                                     Instruction *IPHint, Module& M);
-    void ProcessFunctionBodySimple(Function& F);
-
-  };
-
-  char PoolAllocateSimple::ID = 0;
+char llvm::PoolAllocateSimple::ID = 0;
 
+namespace {
   RegisterPass<PoolAllocateSimple>
   X("poolalloc-simple", "Pool allocate everything into a single global pool");
-
 }
 
 void PoolAllocateSimple::getAnalysisUsage(AnalysisUsage &AU) const {





More information about the llvm-commits mailing list