diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-09-29 05:08:46 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-09-29 05:08:46 +0000 |
commit | 2b4fa5348ee157b6b1a1af44d0137ca8c7a71573 (patch) | |
tree | b3ac8e6a34f562040ad1ac1e7876eceac4f40a52 /clang/lib/CodeGen/CGClass.cpp | |
parent | ac5969933ab7e43d26209ae6c15669842bc86104 (diff) | |
download | bcm5719-llvm-2b4fa5348ee157b6b1a1af44d0137ca8c7a71573.tar.gz bcm5719-llvm-2b4fa5348ee157b6b1a1af44d0137ca8c7a71573.zip |
For P0784R7: compute whether a variable has constant destruction if it
has a constexpr destructor.
For constexpr variables, reject if the variable does not have constant
destruction. In all cases, do not emit runtime calls to the destructor
for variables with constant destruction.
llvm-svn: 373159
Diffstat (limited to 'clang/lib/CodeGen/CGClass.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGClass.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp index c8bb63c5c4b..76ab8852397 100644 --- a/clang/lib/CodeGen/CGClass.cpp +++ b/clang/lib/CodeGen/CGClass.cpp @@ -2083,7 +2083,7 @@ static bool canEmitDelegateCallArgs(CodeGenFunction &CGF, if (CGF.getTarget().getCXXABI().areArgsDestroyedLeftToRightInCallee()) { // If the parameters are callee-cleanup, it's not safe to forward. for (auto *P : Ctor->parameters()) - if (P->getType().isDestructedType()) + if (P->needsDestruction(CGF.getContext())) return false; // Likewise if they're inalloca. |