diff --git a/clang/lib/ExtractAPI/DeclarationFragments.cpp b/clang/lib/ExtractAPI/DeclarationFragments.cpp --- a/clang/lib/ExtractAPI/DeclarationFragments.cpp +++ b/clang/lib/ExtractAPI/DeclarationFragments.cpp @@ -470,7 +470,7 @@ getFragmentsForType(IntegerType, EnumDecl->getASTContext(), After)) .append(std::move(After)); - return Fragments; + return Fragments.append(";", DeclarationFragments::FragmentKind::Text); } DeclarationFragments @@ -493,7 +493,8 @@ if (!Record->getName().empty()) Fragments.appendSpace().append( Record->getName(), DeclarationFragments::FragmentKind::Identifier); - return Fragments; + + return Fragments.append(";", DeclarationFragments::FragmentKind::Text); } DeclarationFragments @@ -743,7 +744,7 @@ .appendSpace() .append(Decl->getName(), DeclarationFragments::FragmentKind::Identifier); - return Fragments; + return Fragments.append(";", DeclarationFragments::FragmentKind::Text); } template diff --git a/clang/test/ExtractAPI/anonymous_record_no_typedef.c b/clang/test/ExtractAPI/anonymous_record_no_typedef.c --- a/clang/test/ExtractAPI/anonymous_record_no_typedef.c +++ b/clang/test/ExtractAPI/anonymous_record_no_typedef.c @@ -94,6 +94,10 @@ "kind": "typeIdentifier", "preciseIdentifier": "c:i", "spelling": "unsigned int" + }, + { + "kind": "text", + "spelling": ";" } ], "docComment": { @@ -241,6 +245,10 @@ { "kind": "identifier", "spelling": "Vehicle" + }, + { + "kind": "text", + "spelling": ";" } ], "docComment": { diff --git a/clang/test/ExtractAPI/enum.c b/clang/test/ExtractAPI/enum.c --- a/clang/test/ExtractAPI/enum.c +++ b/clang/test/ExtractAPI/enum.c @@ -153,6 +153,10 @@ "kind": "typeIdentifier", "preciseIdentifier": "c:i", "spelling": "unsigned int" + }, + { + "kind": "text", + "spelling": ";" } ], "docComment": { @@ -461,6 +465,10 @@ "kind": "typeIdentifier", "preciseIdentifier": "c:c", "spelling": "unsigned char" + }, + { + "kind": "text", + "spelling": ";" } ], "identifier": { @@ -684,6 +692,10 @@ "kind": "typeIdentifier", "preciseIdentifier": "c:i", "spelling": "unsigned int" + }, + { + "kind": "text", + "spelling": ";" } ], "identifier": { @@ -772,6 +784,10 @@ "kind": "typeIdentifier", "preciseIdentifier": "c:i", "spelling": "unsigned int" + }, + { + "kind": "text", + "spelling": ";" } ], "identifier": { diff --git a/clang/test/ExtractAPI/struct.c b/clang/test/ExtractAPI/struct.c --- a/clang/test/ExtractAPI/struct.c +++ b/clang/test/ExtractAPI/struct.c @@ -89,6 +89,10 @@ { "kind": "identifier", "spelling": "Color" + }, + { + "kind": "text", + "spelling": ";" } ], "docComment": { diff --git a/clang/test/ExtractAPI/typedef.c b/clang/test/ExtractAPI/typedef.c --- a/clang/test/ExtractAPI/typedef.c +++ b/clang/test/ExtractAPI/typedef.c @@ -66,6 +66,10 @@ { "kind": "identifier", "spelling": "MyInt" + }, + { + "kind": "text", + "spelling": ";" } ], "identifier": { diff --git a/clang/test/ExtractAPI/typedef_anonymous_record.c b/clang/test/ExtractAPI/typedef_anonymous_record.c --- a/clang/test/ExtractAPI/typedef_anonymous_record.c +++ b/clang/test/ExtractAPI/typedef_anonymous_record.c @@ -75,6 +75,10 @@ { "kind": "identifier", "spelling": "MyEnum" + }, + { + "kind": "text", + "spelling": ";" } ], "identifier": { @@ -170,6 +174,10 @@ { "kind": "identifier", "spelling": "MyStruct" + }, + { + "kind": "text", + "spelling": ";" } ], "identifier": { @@ -223,6 +231,10 @@ { "kind": "identifier", "spelling": "MyStructStruct" + }, + { + "kind": "text", + "spelling": ";" } ], "identifier": { @@ -283,6 +295,10 @@ { "kind": "identifier", "spelling": "MyStructStructStruct" + }, + { + "kind": "text", + "spelling": ";" } ], "identifier": { @@ -343,6 +359,10 @@ { "kind": "identifier", "spelling": "MyEnumEnum" + }, + { + "kind": "text", + "spelling": ";" } ], "identifier": { @@ -403,6 +423,10 @@ { "kind": "identifier", "spelling": "MyEnumEnumEnum" + }, + { + "kind": "text", + "spelling": ";" } ], "identifier": { diff --git a/clang/test/ExtractAPI/typedef_chain.c b/clang/test/ExtractAPI/typedef_chain.c --- a/clang/test/ExtractAPI/typedef_chain.c +++ b/clang/test/ExtractAPI/typedef_chain.c @@ -68,6 +68,10 @@ { "kind": "identifier", "spelling": "MyInt" + }, + { + "kind": "text", + "spelling": ";" } ], "identifier": { @@ -128,6 +132,10 @@ { "kind": "identifier", "spelling": "MyIntInt" + }, + { + "kind": "text", + "spelling": ";" } ], "identifier": { @@ -188,6 +196,10 @@ { "kind": "identifier", "spelling": "MyIntIntInt" + }, + { + "kind": "text", + "spelling": ";" } ], "identifier": { diff --git a/clang/test/ExtractAPI/underscored.c b/clang/test/ExtractAPI/underscored.c --- a/clang/test/ExtractAPI/underscored.c +++ b/clang/test/ExtractAPI/underscored.c @@ -135,6 +135,10 @@ { "kind": "identifier", "spelling": "ExposedRecord" + }, + { + "kind": "text", + "spelling": ";" } ], "identifier": { @@ -296,6 +300,10 @@ { "kind": "identifier", "spelling": "ExposedTypedef" + }, + { + "kind": "text", + "spelling": ";" } ], "identifier": { @@ -356,6 +364,10 @@ { "kind": "identifier", "spelling": "ExposedTypedefToHidden" + }, + { + "kind": "text", + "spelling": ";" } ], "identifier": {