]> granicus.if.org Git - clang/commit
Add a destruct-on-exit function to ASTContext.
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Tue, 14 Feb 2017 05:37:36 +0000 (05:37 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Tue, 14 Feb 2017 05:37:36 +0000 (05:37 +0000)
commit0b0a12c5693701cc54458d3c3981850547a9840e
tree7158c754c5a8dd3c372622ef914365b61ffcb462
parentc09a8490d3f68ebf6a348e8f410bfc8338e1632f
Add a destruct-on-exit function to ASTContext.

It looks like the only use of AddDeallocation is to indirectly call the
destructors of objects. In one case I found
(TypeAliasTemplateDecl::Common), the destructor is a nop, so registering
it to run later seems pointless.

All of the other *::Common types have non-trivial dtors, so deleting the
useless AddDeallocation felt somewhat fragile. Happy to kill it + turn
the is_trivial_dtor check into a static_assert if people think that'd be
better.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295029 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/ASTContext.h
include/clang/AST/DeclTemplate.h
lib/AST/Decl.cpp
lib/AST/DeclTemplate.cpp