[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO
Roman Rusyaev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 25 13:40:35 PDT 2022
rusyaev-roman added inline comments.
================
Comment at: clang/include/clang/Sema/Scope.h:213-215
+ /// A single NRVO candidate variable in this scope, or nullptr if the
+ /// candidate is not available/allowed in this scope.
+ Optional<VarDecl *> NRVO;
----------------
ChuanqiXu wrote:
> Now NRVO has three states, None, nullptr and non-null value.But it doesn't show in comments and implementations.
Actually it's used. I'll add additional comments for clarification.
================
Comment at: clang/lib/Sema/Scope.cpp:151
+void Scope::applyNRVOAndMergeItIntoParent() {
+ if (!NRVO.hasValue())
+ // There is no NRVO candidate in the current scope.
----------------
ChuanqiXu wrote:
>
nullptr should be considered below. I'll add a comment to demonstrate why it is.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119792/new/
https://reviews.llvm.org/D119792
More information about the cfe-commits
mailing list