From bd6fa3d032acd7eafc6c10827c41103df45beab7 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sun, 8 Feb 2009 00:16:35 +0000 Subject: When emitting blocks, keep track of which cleanup scope they have. Minor fixes and cleanup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64053 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenFunction.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/CodeGen/CodeGenFunction.h') diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index 8a0220724e..3dbc2c99e7 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -253,11 +253,22 @@ private: explicit CleanupEntry(llvm::BasicBlock *cb) : CleanupBlock(cb) {} + + ~CleanupEntry() { + assert(Blocks.empty() && "Did not empty blocks!"); + assert(BranchFixups.empty() && "Did not empty branch fixups!"); + } + }; /// CleanupEntries - Stack of cleanup entries. llvm::SmallVector CleanupEntries; + typedef llvm::DenseMap BlockScopeMap; + + /// BlockScopes - Map of which "cleanup scope" scope basic blocks have. + BlockScopeMap BlockScopes; + public: CodeGenFunction(CodeGenModule &cgm); -- cgit v1.2.3