[PATCH] D140010: [clang][ExtractAPI] Fix naming of typedef'd anonymous enums

Daniel Grumberg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 14 10:45:25 PST 2022


dang added inline comments.


================
Comment at: clang/lib/ExtractAPI/ExtractAPIVisitor.cpp:174-175
+  StringRef Name = Decl->getName();
   if (Name.empty())
     Name = getTypedefName(Decl);
+  if (Name.empty()) {
----------------
zixuw wrote:
> Aren't these two lines supposed to do this?
Qualified name is never empty, just contains some version of anonymous, whereas getName() is actually empty for anonymous types. The flow is now, try to populate with `getName` (which is unqualified and puts us in a better spot for the eventual support of c++ and nested types). and if that doesn't work fallback to the qualified name.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140010



More information about the cfe-commits mailing list