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

John Criswell criswell at uiuc.edu
Tue Apr 8 09:49:42 PDT 2008


Author: criswell
Date: Tue Apr  8 11:49:41 2008
New Revision: 49387

URL: http://llvm.org/viewvc/llvm-project?rev=49387&view=rev
Log:
Fixed linking errors with PoolAllocateGroup analysis group.  This required
defining all virtual methods in the PoolAllocateGroup class.
Added some macros which should force linking of most PoolAllocate classes.

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

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

==============================================================================
--- poolalloc/trunk/include/poolalloc/PoolAllocate.h (original)
+++ poolalloc/trunk/include/poolalloc/PoolAllocate.h Tue Apr  8 11:49:41 2008
@@ -109,26 +109,34 @@
 } // end PA namespace
 
 
-class PoolAllocateGroup : public ImmutablePass {
+class PoolAllocateGroup {
+private:
+  EquivClassGraphs *ECGraphs;
+
 public:
   static char ID;
-  virtual PA::FuncInfo *getFuncInfo(Function &F);
-  virtual PA::FuncInfo *getFuncInfoOrClone(Function &F);
-  virtual DSGraph & getDSGraph (const Function & F) const;
+  virtual ~PoolAllocateGroup () {}
+  virtual PA::FuncInfo *getFuncInfo(Function &F) { return 0;}
+  virtual PA::FuncInfo *getFuncInfoOrClone(Function &F) {return 0;}
+  virtual DSGraph & getDSGraph (const Function & F) const {
+    return ECGraphs->getDSGraph (F);
+  }
 
-  virtual DSGraph & getGlobalsGraph () const;
+  virtual DSGraph & getGlobalsGraph () const {
+    return ECGraphs->getGlobalsGraph ();
+  }
 
-  virtual Value * getPool (const DSNode * N, Function & F);
+  virtual Value * getPool (const DSNode * N, Function & F) {return 0;}
 
-  virtual Value * getGlobalPool (const DSNode * Node);
+  virtual Value * getGlobalPool (const DSNode * Node) {return 0;}
 
-  virtual CompleteBUDataStructures::callee_iterator callee_begin (CallInst *CI);
-  virtual CompleteBUDataStructures::callee_iterator callee_end   (CallInst *CI);
+  virtual CompleteBUDataStructures::callee_iterator callee_begin (CallInst *CI) { return ECGraphs->callee_begin(CI);}
+  virtual CompleteBUDataStructures::callee_iterator callee_end   (CallInst *CI) { return ECGraphs->callee_end(CI);}
 };
 
 /// PoolAllocate - The main pool allocation pass
 ///
-class PoolAllocate : public ModulePass {
+class PoolAllocate : public ModulePass , public PoolAllocateGroup {
   /// PassAllArguments - If set to true, we should pass pool descriptor
   /// arguments into any function that loads or stores to a pool, in addition to
   /// those functions that allocate or deallocate.  See also the
@@ -379,4 +387,8 @@
   };
 }
 
+FORCE_DEFINING_FILE_TO_BE_LINKED(PoolAllocateGroup)
+FORCE_DEFINING_FILE_TO_BE_LINKED(PoolAllocateSimple)
+FORCE_DEFINING_FILE_TO_BE_LINKED(PoolAllocate)
+
 #endif

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

==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PASimple.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PASimple.cpp Tue Apr  8 11:49:41 2008
@@ -47,7 +47,7 @@
   RegisterPass<PoolAllocateSimple>
   X("poolalloc-simple", "Pool allocate everything into a single global pool");
 
-  RegisterAnalysisGroup<PoolAllocateGroup> PAGroup1(X);
+  RegisterAnalysisGroup<PoolAllocateGroup, true> PAGroup1(X);
 }
 
 static inline Value *
@@ -276,3 +276,4 @@
   return GV;
 }
 
+DEFINING_FILE_FOR(PoolAllocateSimple)

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

==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Tue Apr  8 11:49:41 2008
@@ -986,3 +986,7 @@
     InitializeAndDestroyPool(F, Node, PoolDescriptors, PoolUses, PoolFrees);
   }
 }
+
+DEFINING_FILE_FOR(PoolAllocateGroup)
+DEFINING_FILE_FOR(PoolAllocate)
+





More information about the llvm-commits mailing list