[PATCH] D48894: [AST] Rename some Redeclarable functions to reduce confusion
Richard Smith - zygoloid via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 3 19:25:48 PDT 2018
rsmith added inline comments.
================
Comment at: include/clang/AST/Redeclarable.h:106
- mutable llvm::PointerUnion<NotKnownLatest, KnownLatest> Next;
+ mutable llvm::PointerUnion<NotKnownLatest, KnownLatest> Prev;
----------------
I think this is still a confusing name, because it points either to the previous declaration or to the latest one. How about just calling this `Link`? Or if you want to be more explicit, `PrevOrLatest`. (But that name is still slightly inaccurate due to the `UninitializedLatest` case.)
================
Comment at: include/clang/AST/Redeclarable.h:117-120
+ return !(Prev.is<NotKnownLatest>() &&
+ // FIXME: 'template' is required on the next line due to an
+ // apparent clang bug.
+ Prev.get<NotKnownLatest>().template is<Previous>());
----------------
This would be simpler and more obvious as:
```
return Prev.is<KnownLatest>() ||
// FIXME: 'template' is required on the next line due to an
// apparent clang bug.
Prev.get<NotKnownLatest>().template is<UninitializedLatest>());
```
Repository:
rC Clang
https://reviews.llvm.org/D48894
More information about the cfe-commits
mailing list