[PATCH] D134303: [AST] Preserve more structure in UsingEnumDecl node.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 12 10:57:01 PDT 2022


sammccall added inline comments.


================
Comment at: clang/include/clang/AST/DeclCXX.h:3618
+  /// The source location of the 'enum' keyword.
+  SourceLocation EnumLoc;
+  /// 'qual::SomeEnum' as an EnumType, possibly with Elaborated/Typedef sugar.
----------------
hokein wrote:
> nit: we only rename  `EnumLocation` but not the `UsingLocation`, it is a little wired, I think either we rename both or keep both unchanged.
> 
oops, at some point this was matching the use of a `TypeLoc` vs `SourceLocation`, but no longer does. Fixed


================
Comment at: clang/include/clang/AST/DeclCXX.h:3623
   /// The enum
   EnumDecl *Enum;
 
----------------
hokein wrote:
> I think we can probably get rid of the `Enum` field, since we are storing the EnumType and we can get the EnumDecl by `dyn_cast<EnumDecl>(EnumType->getType()->getAsTagDecl())`
Good point. Did this an added an assert in create().


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134303/new/

https://reviews.llvm.org/D134303



More information about the cfe-commits mailing list