aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-12-09 03:35:49 +0000
committerMike Stump <mrs@apple.com>2009-12-09 03:35:49 +0000
commitd88ea5687968640ada2bc5a10211cbeb68a671ec (patch)
tree746146fb62e1ea8b04c56ff8b6fdb2d6e6108be6 /lib/CodeGen/CodeGenFunction.cpp
parent871b2e7c0f70f87b87b5d5e110391d016a309b63 (diff)
Add cleanups for exceptional edges. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90940 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 4b32999020..adfd75b42a 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -34,6 +34,7 @@ CodeGenFunction::CodeGenFunction(CodeGenModule &cgm)
ConditionalBranchLevel(0) {
LLVMIntTy = ConvertType(getContext().IntTy);
LLVMPointerWidth = Target.getPointerWidth(0);
+ Exceptions = getContext().getLangOptions().Exceptions;
}
ASTContext &CodeGenFunction::getContext() const {
@@ -625,9 +626,10 @@ llvm::Value* CodeGenFunction::EmitVAListRef(const Expr* E) {
void CodeGenFunction::PushCleanupBlock(llvm::BasicBlock *CleanupEntryBlock,
llvm::BasicBlock *CleanupExitBlock,
+ llvm::BasicBlock *PreviousInvokeDest,
bool EHOnly) {
CleanupEntries.push_back(CleanupEntry(CleanupEntryBlock, CleanupExitBlock,
- EHOnly));
+ PreviousInvokeDest, EHOnly));
}
void CodeGenFunction::EmitCleanupBlocks(size_t OldCleanupStackSize) {
@@ -651,6 +653,8 @@ CodeGenFunction::CleanupBlockInfo CodeGenFunction::PopCleanupBlock() {
bool EHOnly = CE.EHOnly;
+ setInvokeDest(CE.PreviousInvokeDest);
+
CleanupEntries.pop_back();
// Check if any branch fixups pointed to the scope we just popped. If so,