diff --git a/clang/lib/Frontend/ASTConsumers.cpp b/clang/lib/Frontend/ASTConsumers.cpp --- a/clang/lib/Frontend/ASTConsumers.cpp +++ b/clang/lib/Frontend/ASTConsumers.cpp @@ -57,8 +57,11 @@ bool ShowColors = Out.has_colors(); if (ShowColors) Out.changeColor(raw_ostream::BLUE); - Out << (OutputKind != Print ? "Dumping " : "Printing ") << getName(D) - << ":\n"; + + if (OutputFormat == ADOF_Default) + Out << (OutputKind != Print ? "Dumping " : "Printing ") << getName(D) + << ":\n"; + if (ShowColors) Out.resetColor(); print(D); diff --git a/clang/test/AST/ast-dump-comment-json.cpp b/clang/test/AST/ast-dump-comment-json.cpp --- a/clang/test/AST/ast-dump-comment-json.cpp +++ b/clang/test/AST/ast-dump-comment-json.cpp @@ -38,7 +38,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py // using --filters=FullComment - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FullComment", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 72, @@ -107,7 +107,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FullComment", // CHECK-NEXT: "loc": {}, // CHECK-NEXT: "range": { @@ -116,7 +116,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FullComment", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 120, @@ -185,7 +185,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FullComment", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 151, @@ -323,7 +323,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FullComment", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 197, @@ -564,7 +564,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FullComment", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 294, @@ -702,7 +702,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FullComment", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 294, @@ -842,7 +842,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FullComment", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 372, @@ -937,7 +937,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FullComment", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 415, @@ -1122,7 +1122,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FullComment", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 466, @@ -1239,7 +1239,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FullComment", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 537, @@ -1378,7 +1378,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FullComment", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 537, diff --git a/clang/test/AST/ast-dump-decl-context-json.cpp b/clang/test/AST/ast-dump-decl-context-json.cpp --- a/clang/test/AST/ast-dump-decl-context-json.cpp +++ b/clang/test/AST/ast-dump-decl-context-json.cpp @@ -16,7 +16,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "NamespaceDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 116, diff --git a/clang/test/AST/ast-dump-decl-json.c b/clang/test/AST/ast-dump-decl-json.c --- a/clang/test/AST/ast-dump-decl-json.c +++ b/clang/test/AST/ast-dump-decl-json.c @@ -91,7 +91,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "TypedefDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 12, @@ -137,7 +137,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "VarDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 149, @@ -165,7 +165,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "VarDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 186, @@ -195,7 +195,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "RecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 219, @@ -250,7 +250,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "RecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 252, @@ -360,7 +360,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "LabelDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 344, @@ -385,7 +385,7 @@ // CHECK-NEXT: "name": "TestLabelDecl" // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "TypedefDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 411, @@ -421,7 +421,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "EnumDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 434, @@ -474,7 +474,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "RecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 475, @@ -583,7 +583,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "EnumDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 540, @@ -607,7 +607,7 @@ // CHECK-NEXT: "name": "TestEnumDeclForward" // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "RecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 569, @@ -662,7 +662,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "RecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 606, @@ -689,7 +689,7 @@ // CHECK-NEXT: "completeDefinition": true // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "RecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 639, @@ -771,7 +771,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "RecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 708, @@ -851,7 +851,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "RecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 757, @@ -876,7 +876,7 @@ // CHECK-NEXT: "tagUsed": "struct" // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "EnumConstantDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 811, @@ -903,6 +903,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "EnumConstantDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 835, @@ -975,6 +976,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "RecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 875, @@ -1106,6 +1108,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1003, @@ -1280,6 +1283,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1113, @@ -1450,6 +1454,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1168, @@ -1505,7 +1510,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1203, @@ -1533,7 +1538,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1241, @@ -1562,7 +1567,7 @@ // CHECK-NEXT: "storageClass": "extern" // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1274, @@ -1591,7 +1596,7 @@ // CHECK-NEXT: "inline": true // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FieldDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1330, @@ -1618,6 +1623,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FieldDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1351, @@ -1691,6 +1697,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "VarDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1383, @@ -1718,7 +1725,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "VarDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1407, @@ -1747,7 +1754,7 @@ // CHECK-NEXT: "storageClass": "extern" // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "VarDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1435, @@ -1776,6 +1783,7 @@ // CHECK-NEXT: "tls": "static" // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "VarDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1458, @@ -1827,6 +1835,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "ParmVarDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1505, diff --git a/clang/test/AST/ast-dump-decl-json.m b/clang/test/AST/ast-dump-decl-json.m --- a/clang/test/AST/ast-dump-decl-json.m +++ b/clang/test/AST/ast-dump-decl-json.m @@ -85,7 +85,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "ObjCInterfaceDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 172, @@ -121,7 +121,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "ObjCImplementationDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 215, @@ -291,7 +291,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "ObjCMethodDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 408, @@ -349,6 +349,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "ObjCMethodDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 490, @@ -499,6 +500,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "ObjCProtocolDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 562, @@ -553,7 +555,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "ObjCInterfaceDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 614, @@ -626,7 +628,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "ObjCImplementationDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 672, @@ -771,7 +773,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "ObjCCategoryDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 737, @@ -843,7 +845,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "ObjCInterfaceDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 809, @@ -914,7 +916,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "ObjCCategoryImplDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 866, @@ -1032,7 +1034,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "ObjCCompatibleAliasDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 926, @@ -1061,7 +1063,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "ObjCInterfaceDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 990, @@ -1339,7 +1341,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "ObjCImplementationDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1107, @@ -1674,6 +1676,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1184, @@ -1959,6 +1962,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "VarDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1296, diff --git a/clang/test/AST/ast-dump-enum-json.cpp b/clang/test/AST/ast-dump-enum-json.cpp --- a/clang/test/AST/ast-dump-enum-json.cpp +++ b/clang/test/AST/ast-dump-enum-json.cpp @@ -33,7 +33,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py // using --filters=EnumDecl - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "EnumDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 88, @@ -111,7 +111,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "EnumDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 117, @@ -189,7 +189,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "EnumDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 146, @@ -270,7 +270,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "EnumDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 188, @@ -352,7 +352,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "EnumDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 224, @@ -434,7 +434,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "EnumDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 257, diff --git a/clang/test/AST/ast-dump-expr-json.c b/clang/test/AST/ast-dump-expr-json.c --- a/clang/test/AST/ast-dump-expr-json.c +++ b/clang/test/AST/ast-dump-expr-json.c @@ -109,7 +109,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py // using --filters=FunctionDecl - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 118, @@ -270,7 +270,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 151, @@ -529,7 +529,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 199, @@ -963,7 +963,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 252, @@ -3335,7 +3335,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 646, @@ -4003,7 +4003,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 861, @@ -4900,7 +4900,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1079, diff --git a/clang/test/AST/ast-dump-expr-json.cpp b/clang/test/AST/ast-dump-expr-json.cpp --- a/clang/test/AST/ast-dump-expr-json.cpp +++ b/clang/test/AST/ast-dump-expr-json.cpp @@ -155,6 +155,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 952, @@ -270,6 +271,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 995, @@ -1016,6 +1018,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1149, @@ -1402,6 +1405,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionTemplateDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1326, @@ -2479,6 +2483,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1541, @@ -3555,6 +3560,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionTemplateDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1841, @@ -7753,6 +7759,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 2336, @@ -8190,6 +8197,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 2387, @@ -8470,6 +8478,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 2437, @@ -8952,6 +8961,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 2559, diff --git a/clang/test/AST/ast-dump-expr-json.m b/clang/test/AST/ast-dump-expr-json.m --- a/clang/test/AST/ast-dump-expr-json.m +++ b/clang/test/AST/ast-dump-expr-json.m @@ -97,6 +97,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1506, @@ -242,6 +243,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1574, @@ -421,6 +423,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1640, @@ -582,6 +585,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1678, @@ -705,6 +709,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1737, @@ -891,6 +896,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1817, @@ -1913,6 +1919,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1892, @@ -4760,6 +4767,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 2060, @@ -4964,6 +4972,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 2113, diff --git a/clang/test/AST/ast-dump-file-line-json.c b/clang/test/AST/ast-dump-file-line-json.c --- a/clang/test/AST/ast-dump-file-line-json.c +++ b/clang/test/AST/ast-dump-file-line-json.c @@ -12,7 +12,7 @@ int e; // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "TranslationUnitDecl", // CHECK-NEXT: "loc": {}, // CHECK-NEXT: "range": { diff --git a/clang/test/AST/ast-dump-funcs-json.cpp b/clang/test/AST/ast-dump-funcs-json.cpp --- a/clang/test/AST/ast-dump-funcs-json.cpp +++ b/clang/test/AST/ast-dump-funcs-json.cpp @@ -43,7 +43,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXMethodDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 124, @@ -71,7 +71,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXMethodDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 140, @@ -99,7 +99,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXMethodDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 162, @@ -127,7 +127,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXMethodDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 187, @@ -155,7 +155,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXMethodDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 205, @@ -183,6 +183,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXMethodDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 232, @@ -285,6 +286,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXMethodDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 271, @@ -314,6 +316,7 @@ // CHECK-NEXT: "pure": true // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXMethodDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 343, @@ -431,6 +434,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXMethodDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 399, @@ -458,7 +462,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXMethodDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 419, @@ -506,7 +510,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 446, @@ -535,7 +539,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 460, @@ -563,7 +567,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 478, @@ -645,6 +649,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 504, @@ -750,6 +755,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 545, @@ -778,7 +784,7 @@ // CHECK-NEXT: "constexpr": true // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 570, @@ -807,7 +813,7 @@ // CHECK-NEXT: "storageClass": "static" // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 595, @@ -836,7 +842,7 @@ // CHECK-NEXT: "storageClass": "extern" // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 620, @@ -865,7 +871,7 @@ // CHECK-NEXT: "inline": true // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 638, @@ -893,7 +899,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 665, @@ -921,7 +927,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 700, @@ -949,7 +955,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionTemplateDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 751, @@ -1056,7 +1062,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 769, @@ -1126,7 +1132,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 789, diff --git a/clang/test/AST/ast-dump-if-json.cpp b/clang/test/AST/ast-dump-if-json.cpp --- a/clang/test/AST/ast-dump-if-json.cpp +++ b/clang/test/AST/ast-dump-if-json.cpp @@ -29,6 +29,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py // using --filters=IfStmt +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "IfStmt", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { @@ -140,6 +141,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "IfStmt", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { @@ -269,6 +271,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "IfStmt", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { @@ -511,6 +514,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "IfStmt", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { @@ -637,6 +641,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "IfStmt", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { @@ -818,6 +823,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "IfStmt", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { diff --git a/clang/test/AST/ast-dump-macro-json.c b/clang/test/AST/ast-dump-macro-json.c --- a/clang/test/AST/ast-dump-macro-json.c +++ b/clang/test/AST/ast-dump-macro-json.c @@ -19,7 +19,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py // using --filters=FunctionDecl - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "spellingLoc": { @@ -55,7 +55,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "spellingLoc": { @@ -91,7 +91,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "spellingLoc": { @@ -126,7 +126,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "spellingLoc": { @@ -163,7 +163,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "spellingLoc": { diff --git a/clang/test/AST/ast-dump-namespace-json.cpp b/clang/test/AST/ast-dump-namespace-json.cpp --- a/clang/test/AST/ast-dump-namespace-json.cpp +++ b/clang/test/AST/ast-dump-namespace-json.cpp @@ -20,7 +20,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py // using --filters=NamespaceDecl - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "NamespaceDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 98, @@ -45,7 +45,7 @@ // CHECK-NEXT: "name": "foo" // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "NamespaceDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 117, @@ -68,12 +68,12 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "NamespaceDecl", // CHECK-NEXT: "name": "" // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "NamespaceDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 132, @@ -124,7 +124,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "NamespaceDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 176, @@ -174,7 +174,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "NamespaceDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 201, diff --git a/clang/test/AST/ast-dump-record-definition-data-json.cpp b/clang/test/AST/ast-dump-record-definition-data-json.cpp --- a/clang/test/AST/ast-dump-record-definition-data-json.cpp +++ b/clang/test/AST/ast-dump-record-definition-data-json.cpp @@ -127,17 +127,17 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py // using --filters=CXXRecordDecl - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "name": "__NSConstantString_tag" // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "name": "__va_list_tag" // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 157, @@ -334,7 +334,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 190, @@ -719,7 +719,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 212, @@ -862,7 +862,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 303, @@ -1003,7 +1003,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 396, @@ -1107,7 +1107,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 417, @@ -1232,7 +1232,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 450, @@ -1357,7 +1357,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 484, @@ -1503,7 +1503,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 530, @@ -1634,7 +1634,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 572, @@ -1899,7 +1899,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 625, @@ -2003,7 +2003,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 658, @@ -2156,7 +2156,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 753, @@ -2281,7 +2281,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 781, @@ -2402,7 +2402,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 813, @@ -2535,7 +2535,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 861, @@ -2680,7 +2680,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 907, @@ -2945,7 +2945,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 954, @@ -3076,7 +3076,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 996, @@ -3343,7 +3343,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1044, @@ -3608,7 +3608,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1091, @@ -3729,7 +3729,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1140, @@ -3862,7 +3862,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1187, @@ -4007,7 +4007,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1261, @@ -4111,7 +4111,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1303, @@ -4260,7 +4260,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1403, @@ -4405,7 +4405,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1497, @@ -4533,7 +4533,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1544, @@ -4658,7 +4658,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1585, @@ -4908,7 +4908,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1642, @@ -5012,6 +5012,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1675, @@ -5162,6 +5163,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1725, diff --git a/clang/test/AST/ast-dump-records-json.cpp b/clang/test/AST/ast-dump-records-json.cpp --- a/clang/test/AST/ast-dump-records-json.cpp +++ b/clang/test/AST/ast-dump-records-json.cpp @@ -87,17 +87,17 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py // using --filters=CXXRecordDecl - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "name": "__NSConstantString_tag" // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "name": "__va_list_tag" // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 102, @@ -122,7 +122,7 @@ // CHECK-NEXT: "tagUsed": "struct" // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 112, @@ -147,6 +147,7 @@ // CHECK-NEXT: "tagUsed": "struct" // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 123, @@ -567,6 +568,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 206, @@ -1191,7 +1193,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 321, @@ -1368,7 +1370,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 368, @@ -1392,7 +1394,7 @@ // CHECK-NEXT: "tagUsed": "union" // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 378, @@ -1416,6 +1418,7 @@ // CHECK-NEXT: "tagUsed": "union" // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 388, @@ -1837,6 +1840,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 470, @@ -2461,7 +2465,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 585, @@ -2702,7 +2706,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 602, @@ -2943,7 +2947,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 619, @@ -3184,7 +3188,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 637, @@ -3296,7 +3300,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 667, @@ -3407,7 +3411,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 705, @@ -3646,7 +3650,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 743, @@ -3899,7 +3903,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 805, @@ -4138,7 +4142,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 882, diff --git a/clang/test/AST/ast-dump-stmt-json.c b/clang/test/AST/ast-dump-stmt-json.c --- a/clang/test/AST/ast-dump-stmt-json.c +++ b/clang/test/AST/ast-dump-stmt-json.c @@ -150,6 +150,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py // using --filters=VarDecl,CompoundStmt +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "VarDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 99, @@ -201,6 +202,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "VarDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 121, @@ -317,6 +319,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CompoundStmt", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { @@ -476,6 +479,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "VarDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 198, @@ -655,6 +659,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CompoundStmt", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { @@ -1297,6 +1302,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CompoundStmt", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { @@ -2053,6 +2059,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CompoundStmt", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { @@ -2335,6 +2342,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CompoundStmt", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { @@ -2831,6 +2839,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CompoundStmt", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { @@ -3613,6 +3622,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CompoundStmt", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { @@ -4820,6 +4830,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CompoundStmt", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { @@ -5064,6 +5075,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CompoundStmt", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { @@ -5244,6 +5256,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "CompoundStmt", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { diff --git a/clang/test/AST/ast-dump-stmt-json.cpp b/clang/test/AST/ast-dump-stmt-json.cpp --- a/clang/test/AST/ast-dump-stmt-json.cpp +++ b/clang/test/AST/ast-dump-stmt-json.cpp @@ -125,7 +125,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py // using --filters=FunctionDecl,FunctionTemplateDecl,UsingDecl,UsingShadowDecl - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 125, @@ -171,7 +171,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "UsingDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 164, @@ -194,7 +194,7 @@ // CHECK-NEXT: "name": "n::function" // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "UsingShadowDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 164, @@ -224,7 +224,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "UsingDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 183, @@ -247,7 +247,7 @@ // CHECK-NEXT: "name": "n::Variable" // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "UsingShadowDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 183, @@ -277,6 +277,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 198, @@ -510,6 +511,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 266, @@ -661,7 +663,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 323, @@ -790,6 +792,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 378, @@ -1422,6 +1425,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": {}, // CHECK-NEXT: "range": { @@ -1479,7 +1483,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": {}, // CHECK-NEXT: "range": { @@ -1558,7 +1562,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": {}, // CHECK-NEXT: "range": { @@ -1616,7 +1620,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": {}, // CHECK-NEXT: "range": { @@ -1695,7 +1699,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": {}, // CHECK-NEXT: "range": { @@ -1735,7 +1739,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": {}, // CHECK-NEXT: "range": { @@ -1787,7 +1791,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": {}, // CHECK-NEXT: "range": { @@ -1827,7 +1831,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": {}, // CHECK-NEXT: "range": { @@ -1879,6 +1883,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionTemplateDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 598, @@ -2101,6 +2106,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionTemplateDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 766, @@ -2607,6 +2613,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionTemplateDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1049, @@ -2873,6 +2880,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1214, @@ -3071,6 +3079,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1261, @@ -3281,6 +3290,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1315, @@ -3964,6 +3974,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1529, @@ -6649,6 +6660,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionTemplateDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 1737, diff --git a/clang/test/AST/ast-dump-stmt-json.m b/clang/test/AST/ast-dump-stmt-json.m --- a/clang/test/AST/ast-dump-stmt-json.m +++ b/clang/test/AST/ast-dump-stmt-json.m @@ -21,6 +21,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 143, @@ -253,6 +254,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 185, @@ -485,6 +487,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 252, diff --git a/clang/test/AST/ast-dump-template-decls-json.cpp b/clang/test/AST/ast-dump-template-decls-json.cpp --- a/clang/test/AST/ast-dump-template-decls-json.cpp +++ b/clang/test/AST/ast-dump-template-decls-json.cpp @@ -60,6 +60,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "TranslationUnitDecl", // CHECK-NEXT: "loc": {}, // CHECK-NEXT: "range": { diff --git a/clang/test/AST/ast-dump-temporaries-json.cpp b/clang/test/AST/ast-dump-temporaries-json.cpp --- a/clang/test/AST/ast-dump-temporaries-json.cpp +++ b/clang/test/AST/ast-dump-temporaries-json.cpp @@ -21,6 +21,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py // using --filters=ExprWithCleanups +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "ExprWithCleanups", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { @@ -154,6 +155,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "ExprWithCleanups", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { @@ -251,6 +253,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "ExprWithCleanups", // CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { diff --git a/clang/test/AST/ast-dump-types-json.cpp b/clang/test/AST/ast-dump-types-json.cpp --- a/clang/test/AST/ast-dump-types-json.cpp +++ b/clang/test/AST/ast-dump-types-json.cpp @@ -27,7 +27,7 @@ // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "TypedefDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 204, @@ -78,7 +78,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "TypedefDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 239, @@ -130,7 +130,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "TypedefDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 319, @@ -239,7 +239,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "TypedefDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 366, @@ -316,7 +316,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "TypedefDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 416, @@ -374,7 +374,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "TypedefDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 456, @@ -446,7 +446,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "TypedefDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 506, @@ -482,7 +482,7 @@ // CHECK-NEXT: ] // CHECK-NEXT: } - +// CHECK-NOT: {{^}}Dumping // CHECK: "kind": "NamespaceDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "offset": 541, diff --git a/clang/test/AST/gen_ast_dump_json_test.py b/clang/test/AST/gen_ast_dump_json_test.py --- a/clang/test/AST/gen_ast_dump_json_test.py +++ b/clang/test/AST/gen_ast_dump_json_test.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from collections import OrderedDict @@ -6,7 +6,6 @@ import argparse import json import os -import pprint import re import subprocess import sys @@ -21,20 +20,19 @@ for e in v: if isinstance(e, OrderedDict): normalize(e) - elif type(v) is unicode: - st = v.encode('utf-8') + elif type(v) is str: if v != "0x0" and re.match(r"0x[0-9A-Fa-f]+", v): - dict_var[k] = u'0x{{.*}}' + dict_var[k] = '0x{{.*}}' elif os.path.isfile(v): - dict_var[k] = u'{{.*}}' + dict_var[k] = '{{.*}}' else: - splits = (v.split(u' ')) + splits = (v.split(' ')) out_splits = [] for split in splits: - inner_splits = split.rsplit(u':',2) + inner_splits = split.rsplit(':',2) if os.path.isfile(inner_splits[0]): out_splits.append( - u'{{.*}}:%s:%s' + '{{.*}}:%s:%s' %(inner_splits[1], inner_splits[2])) continue @@ -42,11 +40,11 @@ dict_var[k] = ' '.join(out_splits) + def filter_json(dict_var, filters, out): for k, v in dict_var.items(): - if type(v) is unicode: - st = v.encode('utf-8') - if st in filters: + if type(v) is str: + if v in filters: out.append(dict_var) break elif isinstance(v, OrderedDict): @@ -154,33 +152,39 @@ print("Will use the following filters:", filters) try: - json_str = subprocess.check_output(cmd) + json_str = subprocess.check_output(cmd).decode() except Exception as ex: print("The clang command failed with %s" % ex) return -1 out_asts = [] if using_ast_dump_filter: - splits = re.split('Dumping .*:\n', json_str) - if len(splits) > 1: - for split in splits[1:]: - j = json.loads(split.decode('utf-8'), object_pairs_hook=OrderedDict) + # If we're using a filter, then we might have multiple JSON objects + # in the output. To parse each out, we use a manual JSONDecoder in + # "raw" mode and update our location in the string based on where the + # last document ended. + decoder = json.JSONDecoder(object_hook=OrderedDict) + doc_start = 0 + prev_end = 0 + while True: + try: + prev_end = doc_start + (j, doc_start) = decoder.raw_decode(json_str[doc_start:]) + doc_start += prev_end + 1 normalize(j) out_asts.append(j) + except: + break else: - j = json.loads(json_str.decode('utf-8'), object_pairs_hook=OrderedDict) + j = json.loads(json_str, object_pairs_hook=OrderedDict) normalize(j) if len(filters) == 0: out_asts.append(j) else: - #assert using_ast_dump_filter is False,\ - # "Does not support using compiler's ast-dump-filter "\ - # "and the tool's filter option at the same time yet." - filter_json(j, filters, out_asts) - with tempfile.NamedTemporaryFile("wb", delete=False) as f: + with tempfile.NamedTemporaryFile("w", delete=False) as f: with open(source_file, "r") as srcf: for line in srcf.readlines(): # copy up to the note: @@ -191,6 +195,7 @@ for out_ast in out_asts: append_str = json.dumps(out_ast, indent=1, ensure_ascii=False) out_str = '\n\n' + out_str += "// CHECK-NOT: {{^}}Dumping\n" index = 0 for append_line in append_str.splitlines()[2:]: if index == 0: