[PATCH] D99732: [AST] Pick last tentative definition as the acting definition
Richard Smith - zygoloid via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 1 16:12:26 PDT 2021
rsmith added a comment.
Thanks, this makes sense.
================
Comment at: clang/lib/AST/Decl.cpp:2192
DefinitionKind Kind = isThisDeclarationADefinition();
- if (Kind != TentativeDefinition)
+ if (Kind != TentativeDefinition || hasDefinition())
return nullptr;
----------------
Is there a good reason to switch from checking for a `Definition` in the loop to checking it ahead of time? This change means we'll do two passes over the redeclarations, and call `isThisDeclarationADefinition` twice for each, where the old approach only performed one pass.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99732/new/
https://reviews.llvm.org/D99732
More information about the cfe-commits
mailing list