summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2014-10-08 18:31:54 +0000
committerKostya Serebryany <kcc@google.com>2014-10-08 18:31:54 +0000
commitb21aa76a8c8dc145c722c9dc3df24466ea308d5e (patch)
treeeb9bb9c921e9d284678b00405169965fc1c9b32b /clang/lib/CodeGen
parentd07cfd3ae4c6a99d06c67549d7a946a870ce228a (diff)
downloadbcm5719-llvm-b21aa76a8c8dc145c722c9dc3df24466ea308d5e.tar.gz
bcm5719-llvm-b21aa76a8c8dc145c722c9dc3df24466ea308d5e.zip
Replace a destructor of EHCleanupScope with a Destroy() method to reflect the current usage.
Summary: The current code uses memset to re-initialize EHCleanupScope objects with breaks the assumptions of the upcoming asan's intra-object-overflow checker. If there is no DTOR, the new checker will refuse to work. Test Plan: bootstrap with asan Reviewers: rnk Reviewed By: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5656 llvm-svn: 219331
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGCleanup.cpp2
-rw-r--r--clang/lib/CodeGen/CGCleanup.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGCleanup.cpp b/clang/lib/CodeGen/CGCleanup.cpp
index 911734ae8e8..12c587ee95a 100644
--- a/clang/lib/CodeGen/CGCleanup.cpp
+++ b/clang/lib/CodeGen/CGCleanup.cpp
@@ -184,7 +184,7 @@ void EHScopeStack::popCleanup() {
StartOfData += Cleanup.getAllocatedSize();
// Destroy the cleanup.
- Cleanup.~EHCleanupScope();
+ Cleanup.Destroy();
// Check whether we can shrink the branch-fixups stack.
if (!BranchFixups.empty()) {
diff --git a/clang/lib/CodeGen/CGCleanup.h b/clang/lib/CodeGen/CGCleanup.h
index ef93389ce5a..cbc51c33cd1 100644
--- a/clang/lib/CodeGen/CGCleanup.h
+++ b/clang/lib/CodeGen/CGCleanup.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; }
OpenPOWER on IntegriCloud