r361768 - When dumping the AST to JSON, dump whether a function is variadic or not.
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Mon May 27 07:29:10 PDT 2019
Author: aaronballman
Date: Mon May 27 07:29:10 2019
New Revision: 361768
URL: http://llvm.org/viewvc/llvm-project?rev=361768&view=rev
Log:
When dumping the AST to JSON, dump whether a function is variadic or not.
Modified:
cfe/trunk/lib/AST/JSONNodeDumper.cpp
cfe/trunk/test/AST/ast-dump-expr-json.cpp
Modified: cfe/trunk/lib/AST/JSONNodeDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/JSONNodeDumper.cpp?rev=361768&r1=361767&r2=361768&view=diff
==============================================================================
--- cfe/trunk/lib/AST/JSONNodeDumper.cpp (original)
+++ cfe/trunk/lib/AST/JSONNodeDumper.cpp Mon May 27 07:29:10 2019
@@ -572,6 +572,8 @@ void JSONNodeDumper::VisitFunctionDecl(c
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");
Modified: cfe/trunk/test/AST/ast-dump-expr-json.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/AST/ast-dump-expr-json.cpp?rev=361768&r1=361767&r2=361768&view=diff
==============================================================================
--- cfe/trunk/test/AST/ast-dump-expr-json.cpp (original)
+++ cfe/trunk/test/AST/ast-dump-expr-json.cpp Mon May 27 07:29:10 2019
@@ -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{{.*}}",
More information about the cfe-commits
mailing list