From ca064d85f1099f8141fc4c85be139571ad3b1c06 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 27 May 2019 14:29:10 +0000 Subject: [PATCH] When dumping the AST to JSON, dump whether a function is variadic or not. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361768 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/JSONNodeDumper.cpp | 2 ++ test/AST/ast-dump-expr-json.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/AST/JSONNodeDumper.cpp b/lib/AST/JSONNodeDumper.cpp index 760ea33812..08f63fba98 100644 --- a/lib/AST/JSONNodeDumper.cpp +++ b/lib/AST/JSONNodeDumper.cpp @@ -572,6 +572,8 @@ void JSONNodeDumper::VisitFunctionDecl(const FunctionDecl *FD) { attributeOnlyIfTrue("pure", FD->isPure()); attributeOnlyIfTrue("explicitlyDeleted", FD->isDeletedAsWritten()); attributeOnlyIfTrue("constexpr", FD->isConstexpr()); + attributeOnlyIfTrue("variadic", FD->isVariadic()); + if (FD->isDefaulted()) JOS.attribute("explicitlyDefaulted", FD->isDeleted() ? "deleted" : "default"); diff --git a/test/AST/ast-dump-expr-json.cpp b/test/AST/ast-dump-expr-json.cpp index 15a93a08a8..c6ccc950e2 100644 --- a/test/AST/ast-dump-expr-json.cpp +++ b/test/AST/ast-dump-expr-json.cpp @@ -4574,6 +4574,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "qualType": "auto (int, ...) const" // CHECK-NEXT: }, // CHECK-NEXT: "inline": true, +// CHECK-NEXT: "variadic": true, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { // CHECK-NEXT: "id": "0x{{.*}}", @@ -4673,6 +4674,7 @@ void TestNonADLCall3() { // CHECK-NEXT: }, // CHECK-NEXT: "storageClass": "static", // CHECK-NEXT: "inline": true, +// CHECK-NEXT: "variadic": true, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { // CHECK-NEXT: "id": "0x{{.*}}", -- 2.40.0