From fb743a937f6856e3ab1f8ed599677038750a550e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 3 Mar 2003 17:25:18 +0000 Subject: Change the mem2reg interface to accept a TargetData argument git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5685 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/Mem2Reg.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/Transforms/Utils/Mem2Reg.cpp') diff --git a/lib/Transforms/Utils/Mem2Reg.cpp b/lib/Transforms/Utils/Mem2Reg.cpp index 6fbb43f6c3..848c4d6706 100644 --- a/lib/Transforms/Utils/Mem2Reg.cpp +++ b/lib/Transforms/Utils/Mem2Reg.cpp @@ -10,6 +10,7 @@ #include "llvm/Analysis/Dominators.h" #include "llvm/iMemory.h" #include "llvm/Function.h" +#include "llvm/Target/TargetData.h" #include "Support/Statistic.h" namespace { @@ -25,6 +26,7 @@ namespace { // virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); + AU.addRequired(); AU.setPreservesCFG(); } }; @@ -34,6 +36,7 @@ namespace { bool PromotePass::runOnFunction(Function &F) { std::vector Allocas; + const TargetData &TD = getAnalysis(); BasicBlock &BB = F.getEntryNode(); // Get the entry node for the function @@ -41,11 +44,11 @@ bool PromotePass::runOnFunction(Function &F) { // the entry node for (BasicBlock::iterator I = BB.begin(), E = --BB.end(); I != E; ++I) if (AllocaInst *AI = dyn_cast(&*I)) // Is it an alloca? - if (isAllocaPromotable(AI)) + if (isAllocaPromotable(AI, TD)) Allocas.push_back(AI); if (!Allocas.empty()) { - PromoteMemToReg(Allocas, getAnalysis()); + PromoteMemToReg(Allocas, getAnalysis(), TD); NumPromoted += Allocas.size(); return true; } -- cgit v1.2.3