diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-22 00:24:57 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-22 00:24:57 +0000 |
commit | e922c0201916e0b980ab3cfe91e1413e68d55647 (patch) | |
tree | 663be741b84470d97945f01da459a3627af683fd /lib/Transforms/Utils/PromoteMemoryToRegister.cpp | |
parent | 7cf12c7efd37dc12c3ed536a3f4c373dddac2b85 (diff) |
Get rid of the Pass+Context magic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76702 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/PromoteMemoryToRegister.cpp')
-rw-r--r-- | lib/Transforms/Utils/PromoteMemoryToRegister.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index a05170e926..bad7e4c950 100644 --- a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp @@ -183,7 +183,7 @@ namespace { /// AliasSetTracker *AST; - LLVMContext *Context; + LLVMContext &Context; /// AllocaLookup - Reverse mapping of Allocas. /// @@ -216,7 +216,7 @@ namespace { public: PromoteMem2Reg(const std::vector<AllocaInst*> &A, DominatorTree &dt, DominanceFrontier &df, AliasSetTracker *ast, - LLVMContext *C) + LLVMContext &C) : Allocas(A), DT(dt), DF(df), AST(ast), Context(C) {} void run(); @@ -449,7 +449,7 @@ void PromoteMem2Reg::run() { // RenamePassData::ValVector Values(Allocas.size()); for (unsigned i = 0, e = Allocas.size(); i != e; ++i) - Values[i] = Context->getUndef(Allocas[i]->getAllocatedType()); + Values[i] = Context.getUndef(Allocas[i]->getAllocatedType()); // Walks all basic blocks in the function performing the SSA rename algorithm // and inserting the phi nodes we marked as necessary @@ -476,7 +476,7 @@ void PromoteMem2Reg::run() { // Just delete the users now. // if (!A->use_empty()) - A->replaceAllUsesWith(Context->getUndef(A->getType())); + A->replaceAllUsesWith(Context.getUndef(A->getType())); if (AST) AST->deleteValue(A); A->eraseFromParent(); } @@ -562,7 +562,7 @@ void PromoteMem2Reg::run() { BasicBlock::iterator BBI = BB->begin(); while ((SomePHI = dyn_cast<PHINode>(BBI++)) && SomePHI->getNumIncomingValues() == NumBadPreds) { - Value *UndefVal = Context->getUndef(SomePHI->getType()); + Value *UndefVal = Context.getUndef(SomePHI->getType()); for (unsigned pred = 0, e = Preds.size(); pred != e; ++pred) SomePHI->addIncoming(UndefVal, Preds[pred]); } @@ -808,7 +808,7 @@ void PromoteMem2Reg::PromoteSingleBlockAlloca(AllocaInst *AI, AllocaInfo &Info, if (StoresByIndex.empty()) { for (Value::use_iterator UI = AI->use_begin(), E = AI->use_end(); UI != E;) if (LoadInst *LI = dyn_cast<LoadInst>(*UI++)) { - LI->replaceAllUsesWith(Context->getUndef(LI->getType())); + LI->replaceAllUsesWith(Context.getUndef(LI->getType())); if (AST && isa<PointerType>(LI->getType())) AST->deleteValue(LI); LBI.deleteValue(LI); @@ -999,7 +999,7 @@ NextIteration: /// void llvm::PromoteMemToReg(const std::vector<AllocaInst*> &Allocas, DominatorTree &DT, DominanceFrontier &DF, - LLVMContext *Context, AliasSetTracker *AST) { + LLVMContext &Context, AliasSetTracker *AST) { // If there is nothing to do, bail out... if (Allocas.empty()) return; |