[PATCH] D99732: [AST] Pick last tentative definition as the acting definition
Benson Chu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 3 15:01:20 PDT 2021
pestctrl added inline comments.
================
Comment at: clang/lib/AST/Decl.cpp:2192
DefinitionKind Kind = isThisDeclarationADefinition();
- if (Kind != TentativeDefinition)
+ if (Kind != TentativeDefinition || hasDefinition())
return nullptr;
----------------
rsmith wrote:
> 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.
My thought was that separating the logic would make the loop easier to read, but I see that this causes 2 passes vs. 1.
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