Ruturaj4 created this revision. Ruturaj4 added a reviewer: dang. Herald added a reviewer: ributzka. Herald added a project: All. Ruturaj4 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
enums and structs declared inside typedefs have incorrect declaration fragments, where the typedef keyword and other syntax is missing. For the following struct: typedef struct Test { int hello; } Test; The produced declaration is: "declarationFragments": [ { "kind": "keyword", "spelling": "struct" }, { "kind": "text", "spelling": " " }, { "kind": "identifier", "spelling": "Test" } ], instead the declaration fragments should represent the following typedef struct Test { … } Test; This patch removes the condition in SymbolGraphSerializer.cpp file and completes declaration fragments Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D146385 Files: clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp Index: clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp =================================================================== --- clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp +++ clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp @@ -801,11 +801,7 @@ const TypedefRecord &Record) { // 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) + if (Record.UnderlyingType.Name.empty()) return; auto Typedef = serializeAPIRecord(Record);
Index: clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp =================================================================== --- clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp +++ clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp @@ -801,11 +801,7 @@ const TypedefRecord &Record) { // 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) + if (Record.UnderlyingType.Name.empty()) return; auto Typedef = serializeAPIRecord(Record);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits