[PATCH] D44968: [ObjC] Generalize NRVO to cover C structs
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 28 14:52:12 PDT 2018
rjmccall added a comment.
Wow, the IR improvements here are amazing.
================
Comment at: lib/CodeGen/CGDecl.cpp:1119
+ if ((CXXRD && !CXXRD->hasTrivialDestructor()) ||
+ RD->isNonTrivialToPrimitiveCopy()) {
// Create a flag that is used to indicate when the NRVO was applied
----------------
This should be isNonTrivialToPrimitiveDestroy(), I think. The dynamic NRVO flag is specifically tied to whether we should destroy the local variable in its normal cleanup.
Repository:
rC Clang
https://reviews.llvm.org/D44968
More information about the cfe-commits
mailing list