From: Chris Lattner Date: Fri, 29 Mar 2002 06:21:38 +0000 (+0000) Subject: Modularize code a bit X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9d891904342c50af4d859866823382f03bdd9cb5;p=oota-llvm.git Modularize code a bit git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2040 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/IPO/OldPoolAllocate.cpp b/lib/Transforms/IPO/OldPoolAllocate.cpp index 64616cd8fb6..9671c8049dd 100644 --- a/lib/Transforms/IPO/OldPoolAllocate.cpp +++ b/lib/Transforms/IPO/OldPoolAllocate.cpp @@ -66,6 +66,15 @@ namespace { // void addPoolPrototypes(Module *M); + + // CreatePools - Insert instructions into the function we are processing to + // create all of the memory pool objects themselves. This also inserts + // destruction code. Add an alloca for each pool that is allocated to the + // PoolDescriptors vector. + // + void CreatePools(Function *F, const vector &Allocs, + vector &PoolDescriptors); + // processFunction - Convert a function to use pool allocation where // available. // @@ -143,6 +152,22 @@ bool PoolAllocate::processFunction(Function *F) { for (unsigned i = 0, e = Scalars.size(); i != e; ++i) Scalars[i].first->dump(); + // Insert instructions into the function we are processing to create all of + // the memory pool objects themselves. This also inserts destruction code. + vector PoolDescriptors; + CreatePools(F, Allocs, PoolDescriptors); + + return true; +} + + +// CreatePools - Insert instructions into the function we are processing to +// create all of the memory pool objects themselves. This also inserts +// destruction code. Add an alloca for each pool that is allocated to the +// PoolDescriptors vector. +// +void PoolAllocate::CreatePools(Function *F, const vector &Allocs, + vector &PoolDescriptors) { // FIXME: This should use an IP version of the UnifyAllExits pass! vector ReturnNodes; for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) @@ -187,8 +212,6 @@ bool PoolAllocate::processFunction(Function *F) { F->getEntryNode()->getInstList().insert(F->getEntryNode()->begin()+1, EntryNodeInsts.begin(), EntryNodeInsts.end()); - - return false; }