r361766 - When dumping the AST to JSON, dump the argument name to a sizeof pack expression.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon May 27 07:17:32 PDT 2019


Author: aaronballman
Date: Mon May 27 07:17:32 2019
New Revision: 361766

URL: http://llvm.org/viewvc/llvm-project?rev=361766&view=rev
Log:
When dumping the AST to JSON, dump the argument name to a sizeof pack expression.

Modified:
    cfe/trunk/include/clang/AST/JSONNodeDumper.h
    cfe/trunk/lib/AST/JSONNodeDumper.cpp
    cfe/trunk/test/AST/ast-dump-expr-json.cpp

Modified: cfe/trunk/include/clang/AST/JSONNodeDumper.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/JSONNodeDumper.h?rev=361766&r1=361765&r2=361766&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/JSONNodeDumper.h (original)
+++ cfe/trunk/include/clang/AST/JSONNodeDumper.h Mon May 27 07:17:32 2019
@@ -244,6 +244,7 @@ public:
   void VisitImplicitCastExpr(const ImplicitCastExpr *ICE);
   void VisitCallExpr(const CallExpr *CE);
   void VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *TTE);
+  void VisitSizeOfPackExpr(const SizeOfPackExpr *SOPE);
   void VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *ULE);
   void VisitAddrLabelExpr(const AddrLabelExpr *ALE);
 

Modified: cfe/trunk/lib/AST/JSONNodeDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/JSONNodeDumper.cpp?rev=361766&r1=361765&r2=361766&view=diff
==============================================================================
--- cfe/trunk/lib/AST/JSONNodeDumper.cpp (original)
+++ cfe/trunk/lib/AST/JSONNodeDumper.cpp Mon May 27 07:17:32 2019
@@ -894,6 +894,10 @@ void JSONNodeDumper::VisitUnaryExprOrTyp
     JOS.attribute("argType", createQualType(TTE->getArgumentType()));
 }
 
+void JSONNodeDumper::VisitSizeOfPackExpr(const SizeOfPackExpr *SOPE) {
+  VisitNamedDecl(SOPE->getPack());
+}
+
 void JSONNodeDumper::VisitUnresolvedLookupExpr(
     const UnresolvedLookupExpr *ULE) {
   JOS.attribute("usesADL", ULE->requiresADL());

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=361766&r1=361765&r2=361766&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:17:32 2019
@@ -1505,7 +1505,8 @@ void TestNonADLCall3() {
 // CHECK-NEXT:        "type": {
 // CHECK-NEXT:         "qualType": "unsigned long"
 // CHECK-NEXT:        },
-// CHECK-NEXT:        "valueCategory": "rvalue"
+// CHECK-NEXT:        "valueCategory": "rvalue",
+// CHECK-NEXT:        "name": "Ts"
 // CHECK-NEXT:       },
 // CHECK-NEXT:       {
 // CHECK-NEXT:        "id": "0x{{.*}}",




More information about the cfe-commits mailing list