aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-02-08 09:22:19 +0000
committerMike Stump <mrs@apple.com>2009-02-08 09:22:19 +0000
commitec9771d57f94cc204491b3174e88069d08cdd684 (patch)
treea527e1073baecd9628e5c5ec38148d7cad0ace94 /lib/CodeGen/CodeGenFunction.h
parentbfa2ac06d40d9b7411287dd0155d3e47c6c15be6 (diff)
Wire up break and continue processing to the new stack depth adjuster.
If people could beat on it and let me know if there are any new semantics required by newer language standards or DRs or any little details I goofed on, I'd be happy to fix any issues found. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64079 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r--lib/CodeGen/CodeGenFunction.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index 836a36f952..320e26b82d 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -264,12 +264,28 @@ private:
/// the return value of llvm.stacksave() is stored at the top of this stack.
llvm::SmallVector<llvm::Value*, 8> StackSaveValues;
- llvm::DenseMap<const LabelStmt*, llvm::Value *> StackDepthMap;
+ llvm::DenseMap<const void*, llvm::Value *> StackDepthMap;
+
+ /// StackFixupAtLabel - Routine to adjust the stack to the depth the
+ /// stack should be at by the time we transfer control flow to the
+ /// label. This is called as we emit destinations for control flow,
+ /// such as user labels for goto statements and compiler generated
+ /// labels for break and continue processsing. We return true, if
+ /// for any reason we can't generate code for the construct yet.
+ /// See EmitStackUpdate for the paired routine to mark the branch.
+ bool StackFixupAtLabel(const void *);
/// EmitStackUpdate - Routine to adjust the stack to the depth the
/// stack should be at by the time we transfer control flow to the
- /// label.
- void EmitStackUpdate(const LabelStmt &S);
+ /// label. This is called just before emitting branches for user
+ /// level goto processing, branhes for break or continue processing.
+ /// The llvm::value overload is used when handling break and
+ /// continue, as we know the stack depth directly. We return true,
+ /// if for any reason we can't generate code for the construct yet.
+ /// See StackFixupAtLabel for the paired routine to mark the
+ /// destinations.
+ bool EmitStackUpdate(llvm::Value *V);
+ bool EmitStackUpdate(const void *S);
struct CleanupEntry {
/// CleanupBlock - The block of code that does the actual cleanup.