Skip to content

Commit

Permalink
[clang][ExtractAPI] Add semicolon to function declaration fragments
Browse files Browse the repository at this point in the history
Add missing semicolon at the end of function declarations to fragments

Reviewed By: dang

Differential Revision: https://reviews.llvm.org/D149737
  • Loading branch information
chaitanyav committed May 4, 2023
1 parent e12d8f5 commit 14805dc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion clang/lib/ExtractAPI/DeclarationFragments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ DeclarationFragmentsBuilder::getFragmentsForFunction(const FunctionDecl *Func) {
Fragments.append(")", DeclarationFragments::FragmentKind::Text);

// FIXME: Handle exception specifiers: throw, noexcept
return Fragments;
return Fragments.append(";", DeclarationFragments::FragmentKind::Text);
}

DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForEnumConstant(
Expand Down
10 changes: 5 additions & 5 deletions clang/test/ExtractAPI/availability.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void e(void) __attribute__((availability(tvos, unavailable)));
},
{
"kind": "text",
"spelling": "()"
"spelling": "();"
}
],
"functionSignature": {
Expand Down Expand Up @@ -150,7 +150,7 @@ void e(void) __attribute__((availability(tvos, unavailable)));
},
{
"kind": "text",
"spelling": "()"
"spelling": "();"
}
],
"functionSignature": {
Expand Down Expand Up @@ -234,7 +234,7 @@ void e(void) __attribute__((availability(tvos, unavailable)));
},
{
"kind": "text",
"spelling": "()"
"spelling": "();"
}
],
"functionSignature": {
Expand Down Expand Up @@ -334,7 +334,7 @@ void e(void) __attribute__((availability(tvos, unavailable)));
},
{
"kind": "text",
"spelling": "()"
"spelling": "();"
}
],
"functionSignature": {
Expand Down Expand Up @@ -416,7 +416,7 @@ void e(void) __attribute__((availability(tvos, unavailable)));
},
{
"kind": "text",
"spelling": "()"
"spelling": "();"
}
],
"functionSignature": {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/ExtractAPI/global_record.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ char unavailable __attribute__((unavailable));
},
{
"kind": "text",
"spelling": ")"
"spelling": ");"
}
],
"docComment": {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/ExtractAPI/global_record_multifile.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ char unavailable __attribute__((unavailable));
},
{
"kind": "text",
"spelling": ")"
"spelling": ");"
}
],
"docComment": {
Expand Down
4 changes: 2 additions & 2 deletions clang/test/ExtractAPI/macro_undefined.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ FUNC_GEN(bar, const int *, unsigned);
},
{
"kind": "text",
"spelling": "()"
"spelling": "();"
}
],
"functionSignature": {
Expand Down Expand Up @@ -173,7 +173,7 @@ FUNC_GEN(bar, const int *, unsigned);
},
{
"kind": "text",
"spelling": ")"
"spelling": ");"
}
],
"functionSignature": {
Expand Down

0 comments on commit 14805dc

Please sign in to comment.