aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/DemoteRegToStack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Utils/DemoteRegToStack.cpp')
-rw-r--r--lib/Transforms/Utils/DemoteRegToStack.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/DemoteRegToStack.cpp b/lib/Transforms/Utils/DemoteRegToStack.cpp
index 8cc26492c2..3ef6b018bf 100644
--- a/lib/Transforms/Utils/DemoteRegToStack.cpp
+++ b/lib/Transforms/Utils/DemoteRegToStack.cpp
@@ -97,8 +97,8 @@ AllocaInst* llvm::DemoteRegToStack(Instruction &I, bool VolatileLoads,
InsertPt = II.getNormalDest()->begin();
}
- for (; isa<PHINode>(InsertPt); ++InsertPt)
- /* empty */; // Don't insert before any PHI nodes.
+ for (; isa<PHINode>(InsertPt) || isa<LandingPadInst>(InsertPt); ++InsertPt)
+ /* empty */; // Don't insert before any PHI nodes or landingpad instrs.
new StoreInst(&I, Slot, InsertPt);
return Slot;