diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-10-13 01:55:36 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-10-13 01:55:36 +0000 |
| commit | 5b34958b46dc14267d1b06099c3bd43e748716fc (patch) | |
| tree | c3e9bded9164d23dfcc44b90914d040d087e18e5 /clang/lib/CodeGen/ItaniumCXXABI.cpp | |
| parent | ad38fbffad842c3baf4589139271d16d14af0357 (diff) | |
| download | bcm5719-llvm-5b34958b46dc14267d1b06099c3bd43e748716fc.tar.gz bcm5719-llvm-5b34958b46dc14267d1b06099c3bd43e748716fc.zip | |
Support for destroying operator delete, per C++2a proposal P0722.
This feature is not (yet) approved by the C++ committee, so this is liable to
be reverted or significantly modified based on committee feedback.
No functionality change intended for existing code (a new type must be defined
in namespace std to take advantage of this feature).
llvm-svn: 315662
Diffstat (limited to 'clang/lib/CodeGen/ItaniumCXXABI.cpp')
| -rw-r--r-- | clang/lib/CodeGen/ItaniumCXXABI.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp index 6e55a674183..173bc4d8df3 100644 --- a/clang/lib/CodeGen/ItaniumCXXABI.cpp +++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp @@ -3664,6 +3664,18 @@ void ItaniumCXXABI::emitCXXStructor(const CXXMethodDecl *MD, !CGM.TryEmitBaseDestructorAsAlias(DD)) return; + // FIXME: The deleting destructor is equivalent to the selected operator + // delete if: + // * either the delete is a destroying operator delete or the destructor + // would be trivial if it weren't virtual, + // * the conversion from the 'this' parameter to the first parameter of the + // destructor is equivalent to a bitcast, + // * the destructor does not have an implicit "this" return, and + // * the operator delete has the same calling convention and IR function type + // as the destructor. + // In such cases we should try to emit the deleting dtor as an alias to the + // selected 'operator delete'. + llvm::Function *Fn = CGM.codegenCXXStructor(MD, Type); if (CGType == StructorCodegen::COMDAT) { |

