diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.h')
-rw-r--r-- | contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.h b/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.h index 1d4606f..dd156c6 100644 --- a/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.h +++ b/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.h @@ -11,8 +11,8 @@ // //===----------------------------------------------------------------------===// -#ifndef CLANG_CODEGEN_CGCLEANUP_H -#define CLANG_CODEGEN_CGCLEANUP_H +#ifndef LLVM_CLANG_LIB_CODEGEN_CGCLEANUP_H +#define LLVM_CLANG_LIB_CODEGEN_CGCLEANUP_H #include "EHScopeStack.h" #include "llvm/ADT/SmallPtrSet.h" @@ -280,9 +280,11 @@ public: assert(CleanupBits.CleanupSize == cleanupSize && "cleanup size overflow"); } - ~EHCleanupScope() { + void Destroy() { delete ExtInfo; } + // Objects of EHCleanupScope are not destructed. Use Destroy(). + ~EHCleanupScope() LLVM_DELETED_FUNCTION; bool isNormalCleanup() const { return CleanupBits.IsNormalCleanup; } llvm::BasicBlock *getNormalBlock() const { return NormalBlock; } @@ -341,7 +343,7 @@ public: void addBranchAfter(llvm::ConstantInt *Index, llvm::BasicBlock *Block) { struct ExtInfo &ExtInfo = getExtInfo(); - if (ExtInfo.Branches.insert(Block)) + if (ExtInfo.Branches.insert(Block).second) ExtInfo.BranchAfters.push_back(std::make_pair(Block, Index)); } @@ -376,7 +378,7 @@ public: /// /// \return true if the branch-through was new to this scope bool addBranchThrough(llvm::BasicBlock *Block) { - return getExtInfo().Branches.insert(Block); + return getExtInfo().Branches.insert(Block).second; } /// Determines if this cleanup scope has any branch throughs. |