diff options
author | Daniel Grumberg <dgrumberg@apple.com> | 2024-08-19 16:06:25 +0100 |
---|---|---|
committer | Daniel Grumberg <dgrumberg@apple.com> | 2024-08-19 16:06:43 +0100 |
commit | b18b4547f1bfaf6da37b29440a96176e807c2e6c (patch) | |
tree | 46fff4f9bd6d8c90d3cd737bbdf526640bebd3a8 /clang/lib/ExtractAPI/Serialization | |
parent | 7dd6340bdadf86bd0facdea89d1876a5c36dc33b (diff) | |
download | llvm-b18b4547f1bfaf6da37b29440a96176e807c2e6c.zip llvm-b18b4547f1bfaf6da37b29440a96176e807c2e6c.tar.gz llvm-b18b4547f1bfaf6da37b29440a96176e807c2e6c.tar.bz2 |
Revert "[clang][ExtractAPI] Stop dropping fields of nested anonymous record types when they aren't attached to variable declaration (#104600)"
This reverts commit c60da1a271a6bb271e7703b2f7c71fbece67ab78.
Diffstat (limited to 'clang/lib/ExtractAPI/Serialization')
-rw-r--r-- | clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp index 1bce9c5..1f8029c 100644 --- a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp +++ b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp @@ -673,6 +673,14 @@ bool SymbolGraphSerializer::shouldSkip(const APIRecord *Record) const { if (Record->Availability.isUnconditionallyUnavailable()) return true; + // Filter out symbols without a name as we can generate correct symbol graphs + // for them. In practice these are anonymous record types that aren't attached + // to a declaration. + if (auto *Tag = dyn_cast<TagRecord>(Record)) { + if (Tag->IsEmbeddedInVarDeclarator) + return true; + } + // Filter out symbols prefixed with an underscored as they are understood to // be symbols clients should not use. if (Record->Name.starts_with("_")) |