aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGStmt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGStmt.cpp')
-rw-r--r--lib/CodeGen/CGStmt.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index 5072d63593..4c634efb10 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -199,6 +199,10 @@ void CodeGenFunction::EmitBlock(llvm::BasicBlock *BB, bool IsFinished) {
}
bool CodeGenFunction::EmitStackUpdate(llvm::Value *V) {
+ // If we're already at the depth we want...
+ if (StackDepth == V)
+ return false;
+
// V can be 0 here, if it is, be sure to start searching from the
// top of the function, as we want the next save after that point.
for (unsigned int i = 0; i < StackSaveValues.size(); ++i)