Add cleanups for exceptional edges. WIP.

llvm-svn: 90940
This commit is contained in:
Mike Stump
2009-12-09 03:35:49 +00:00
parent daa3d6bb50
commit aff69af918
5 changed files with 174 additions and 34 deletions

View File

@@ -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,