[PATCH] D146363: Update reference output in underscored.c
NagaChaitanya Vellanki via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Mar 18 10:51:36 PDT 2023
chaitanyav created this revision.
Herald added a reviewer: ributzka.
Herald added a project: All.
chaitanyav requested review of this revision.
Herald added a reviewer: dang.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
update reference output in underscored.c, combine return and append semicolon fragment
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D146363
Files:
clang/lib/ExtractAPI/DeclarationFragments.cpp
clang/test/ExtractAPI/underscored.c
Index: clang/test/ExtractAPI/underscored.c
===================================================================
--- clang/test/ExtractAPI/underscored.c
+++ 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": {
Index: clang/lib/ExtractAPI/DeclarationFragments.cpp
===================================================================
--- clang/lib/ExtractAPI/DeclarationFragments.cpp
+++ clang/lib/ExtractAPI/DeclarationFragments.cpp
@@ -470,8 +470,7 @@
getFragmentsForType(IntegerType, EnumDecl->getASTContext(), After))
.append(std::move(After));
- Fragments.append(";", DeclarationFragments::FragmentKind::Text);
- return Fragments;
+ return Fragments.append(";", DeclarationFragments::FragmentKind::Text);
}
DeclarationFragments
@@ -495,8 +494,7 @@
Fragments.appendSpace().append(
Record->getName(), DeclarationFragments::FragmentKind::Identifier);
- Fragments.append(";", DeclarationFragments::FragmentKind::Text);
- return Fragments;
+ return Fragments.append(";", DeclarationFragments::FragmentKind::Text);
}
DeclarationFragments
@@ -746,8 +744,7 @@
.appendSpace()
.append(Decl->getName(), DeclarationFragments::FragmentKind::Identifier);
- Fragments.append(";", DeclarationFragments::FragmentKind::Text);
- return Fragments;
+ return Fragments.append(";", DeclarationFragments::FragmentKind::Text);
}
template <typename FunctionT>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146363.506305.patch
Type: text/x-patch
Size: 2079 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230318/4684627d/attachment.bin>
More information about the cfe-commits
mailing list