[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 25 00:38:21 PDT 2022


ChuanqiXu 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;
----------------
Now NRVO has three states, None, nullptr and non-null value.But it doesn't show in comments and implementations.


================
Comment at: clang/lib/Sema/Scope.cpp:151
+void Scope::applyNRVOAndMergeItIntoParent() {
+  if (!NRVO.hasValue())
+    // There is no NRVO candidate in the current scope.
----------------



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