summaryrefslogtreecommitdiff
path: root/lib/CodeGen/DwarfEHPrepare.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-08-29 19:28:28 +0000
committerChris Lattner <sabre@nondot.org>2010-08-29 19:28:28 +0000
commitc34c2200a8077f98cf5cac9fe6f8a6d69b89b54c (patch)
tree71431f837b95ce41cf77c0ef41cc58aca70e894b /lib/CodeGen/DwarfEHPrepare.cpp
parentcb7f65342291caa3636cb50c0ee04b383cd79f8d (diff)
downloadllvm-c34c2200a8077f98cf5cac9fe6f8a6d69b89b54c.tar.gz
llvm-c34c2200a8077f98cf5cac9fe6f8a6d69b89b54c.tar.bz2
llvm-c34c2200a8077f98cf5cac9fe6f8a6d69b89b54c.tar.xz
inline function into its only caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112455 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/DwarfEHPrepare.cpp')
-rw-r--r--lib/CodeGen/DwarfEHPrepare.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/CodeGen/DwarfEHPrepare.cpp b/lib/CodeGen/DwarfEHPrepare.cpp
index 57f45ec199..01e60e3677 100644
--- a/lib/CodeGen/DwarfEHPrepare.cpp
+++ b/lib/CodeGen/DwarfEHPrepare.cpp
@@ -112,26 +112,19 @@ namespace {
bool FindSelectorAndURoR(Instruction *Inst, bool &URoRInvoke,
SmallPtrSet<IntrinsicInst*, 8> &SelCalls);
- /// DoMem2RegPromotion - Take an alloca call and promote it from memory to a
- /// register.
- bool DoMem2RegPromotion(Value *V) {
- AllocaInst *AI = dyn_cast<AllocaInst>(V);
+ /// PromoteStoreInst - Perform Mem2Reg on a StoreInst.
+ bool PromoteStoreInst(StoreInst *SI) {
+ if (!SI || !DT || !DF) return false;
+
+ AllocaInst *AI = dyn_cast<AllocaInst>(SI->getOperand(1));
if (!AI || !isAllocaPromotable(AI)) return false;
-
+
// Turn the alloca into a register.
std::vector<AllocaInst*> Allocas(1, AI);
PromoteMemToReg(Allocas, *DT, *DF);
return true;
}
- /// PromoteStoreInst - Perform Mem2Reg on a StoreInst.
- bool PromoteStoreInst(StoreInst *SI) {
- if (!SI || !DT || !DF) return false;
- if (DoMem2RegPromotion(SI->getOperand(1)))
- return true;
- return false;
- }
-
/// PromoteEHPtrStore - Promote the storing of an EH pointer into a
/// register. This should get rid of the store and subsequent loads.
bool PromoteEHPtrStore(IntrinsicInst *II) {