diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-02-09 01:03:42 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-02-09 01:03:42 +0000 |
| commit | 1b65c3279d75428d2e1ae1a196c4884d6745d0d8 (patch) | |
| tree | 047d45e440ccac0844ec594b1c857db4a9763151 /llvm/lib | |
| parent | fed557ef7611a3d4a83f17c86067369044e74063 (diff) | |
| download | bcm5719-llvm-1b65c3279d75428d2e1ae1a196c4884d6745d0d8.tar.gz bcm5719-llvm-1b65c3279d75428d2e1ae1a196c4884d6745d0d8.zip | |
Re-commit r259942 (reverted in r260053) with a different workaround for the MSVC bug.
This fixes undefined behavior in C++14 due to the size of the object being
deleted being different from sizeof(dynamic type) when it is allocated with
trailing objects.
MSVC seems to have several bugs around using-declarations changing the access
of a member inherited from a base class, so use forwarding functions instead of
using-declarations to make TrailingObjects::operator delete accessible where
desired.
llvm-svn: 260180
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/IR/AttributeImpl.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/IR/AttributeImpl.h b/llvm/lib/IR/AttributeImpl.h index ca7ae5cbb29..e87f4f7e5c8 100644 --- a/llvm/lib/IR/AttributeImpl.h +++ b/llvm/lib/IR/AttributeImpl.h @@ -171,6 +171,8 @@ class AttributeSetNode final void operator=(const AttributeSetNode &) = delete; AttributeSetNode(const AttributeSetNode &) = delete; public: + void operator delete(void *p) { TrailingObjects::operator delete(p); } + static AttributeSetNode *get(LLVMContext &C, ArrayRef<Attribute> Attrs); bool hasAttribute(Attribute::AttrKind Kind) const { @@ -266,6 +268,8 @@ public: } } + void operator delete(void *p) { TrailingObjects::operator delete(p); } + /// \brief Get the context that created this AttributeSetImpl. LLVMContext &getContext() { return Context; } |

