[ExtractAPI] Include virtual keyword for methods (#145412)
This information was being left out of the symbol graph. rdar://131780883
This commit is contained in:
parent
4b9f7cd856
commit
23b66a68f1
@ -883,6 +883,9 @@ DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForCXXMethod(
|
||||
if (Method->isVolatile())
|
||||
Fragments.append("volatile", DeclarationFragments::FragmentKind::Keyword)
|
||||
.appendSpace();
|
||||
if (Method->isVirtual())
|
||||
Fragments.append("virtual", DeclarationFragments::FragmentKind::Keyword)
|
||||
.appendSpace();
|
||||
|
||||
// Build return type
|
||||
DeclarationFragments After;
|
||||
|
||||
@ -45,11 +45,19 @@ class Foo {
|
||||
// GETCOUNT-NEXT: ]
|
||||
|
||||
// RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix SETL
|
||||
void setLength(int length) noexcept;
|
||||
virtual void setLength(int length) noexcept;
|
||||
// SETL: "!testRelLabel": "memberOf $ c:@S@Foo@F@setLength#I# $ c:@S@Foo"
|
||||
// SETL-LABEL: "!testLabel": "c:@S@Foo@F@setLength#I#"
|
||||
// SETL: "declarationFragments": [
|
||||
// SETL-NEXT: {
|
||||
// SETL-NEXT: "kind": "keyword",
|
||||
// SETL-NEXT: "spelling": "virtual"
|
||||
// SETL-NEXT: },
|
||||
// SETL-NEXT: {
|
||||
// SETL-NEXT: "kind": "text",
|
||||
// SETL-NEXT: "spelling": " "
|
||||
// SETL-NEXT: },
|
||||
// SETL-NEXT: {
|
||||
// SETL-NEXT: "kind": "typeIdentifier",
|
||||
// SETL-NEXT: "preciseIdentifier": "c:v",
|
||||
// SETL-NEXT: "spelling": "void"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user