[PATCH] D123019: [clang][extract-api] Add support for typedefs
Zixu Wang via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 4 14:07:34 PDT 2022
zixuw added inline comments.
Comment at: clang/lib/ExtractAPI/DeclarationFragments.cpp:15
Comment at: clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp:598-605
+ // Typedefs of anonymous types have their entries unified with the underlying
+ // type.
+ bool ShouldDrop = Record.UnderlyingType.Name.empty();
+ // enums declared with `NS_OPTION` have a named enum and a named typedef, with
+ // the same name
+ ShouldDrop |= (Record.UnderlyingType.Name == Record.Name);
+ if (ShouldDrop)
Consider move the should-drop logic into `SymbolGraphSerializer::shouldSkip(const APIRecord &Record) const` so that we have a central place to see and manage which symbols get skipped.
This would also simplify things here as the filtering will automatically get handled in the following `serializeAPIRecord(Record)` line.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the cfe-commits