[clang] 451d059 - [clang] Fix JSON AST output when a filter is used
Shivam Gupta via cfe-commits
cfe-commits at lists.llvm.org
Sat Oct 9 19:15:54 PDT 2021
Author: william woodruff
Date: 2021-10-10T07:46:17+05:30
New Revision: 451d0596d70689190b5ac911ae3ab9fc4c1d7485
URL: https://github.com/llvm/llvm-project/commit/451d0596d70689190b5ac911ae3ab9fc4c1d7485
DIFF: https://github.com/llvm/llvm-project/commit/451d0596d70689190b5ac911ae3ab9fc4c1d7485.diff
LOG: [clang] Fix JSON AST output when a filter is used
Without this, the combination of `-ast-dump=json` and `-ast-dump-filter FILTER` produces invalid JSON: the first line is a string that says `Dumping $SOME_DECL_NAME: `.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D108441
Added:
Modified:
clang/lib/Frontend/ASTConsumers.cpp
clang/test/AST/ast-dump-comment-json.cpp
clang/test/AST/ast-dump-decl-context-json.cpp
clang/test/AST/ast-dump-decl-json.c
clang/test/AST/ast-dump-decl-json.m
clang/test/AST/ast-dump-enum-json.cpp
clang/test/AST/ast-dump-expr-json.c
clang/test/AST/ast-dump-expr-json.cpp
clang/test/AST/ast-dump-expr-json.m
clang/test/AST/ast-dump-file-line-json.c
clang/test/AST/ast-dump-funcs-json.cpp
clang/test/AST/ast-dump-if-json.cpp
clang/test/AST/ast-dump-macro-json.c
clang/test/AST/ast-dump-namespace-json.cpp
clang/test/AST/ast-dump-record-definition-data-json.cpp
clang/test/AST/ast-dump-records-json.cpp
clang/test/AST/ast-dump-stmt-json.c
clang/test/AST/ast-dump-stmt-json.cpp
clang/test/AST/ast-dump-stmt-json.m
clang/test/AST/ast-dump-template-decls-json.cpp
clang/test/AST/ast-dump-temporaries-json.cpp
clang/test/AST/ast-dump-types-json.cpp
clang/test/AST/gen_ast_dump_json_test.py
Removed:
################################################################################
diff --git a/clang/lib/Frontend/ASTConsumers.cpp b/clang/lib/Frontend/ASTConsumers.cpp
index a73cc8876d5d8..96f5926c0d7ed 100644
--- a/clang/lib/Frontend/ASTConsumers.cpp
+++ b/clang/lib/Frontend/ASTConsumers.cpp
@@ -57,8 +57,11 @@ namespace {
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
index 2263ed8a170ff..5787fd7ae4bf1 100644
--- a/clang/test/AST/ast-dump-comment-json.cpp
+++ b/clang/test/AST/ast-dump-comment-json.cpp
@@ -38,7 +38,7 @@ void Test_TemplatedFunctionVariadic(int arg, ...);
// 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 @@ void Test_TemplatedFunctionVariadic(int arg, ...);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
@@ -116,7 +116,7 @@ void Test_TemplatedFunctionVariadic(int arg, ...);
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 120,
@@ -185,7 +185,7 @@ void Test_TemplatedFunctionVariadic(int arg, ...);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 151,
@@ -323,7 +323,7 @@ void Test_TemplatedFunctionVariadic(int arg, ...);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 197,
@@ -564,7 +564,7 @@ void Test_TemplatedFunctionVariadic(int arg, ...);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 294,
@@ -702,7 +702,7 @@ void Test_TemplatedFunctionVariadic(int arg, ...);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 294,
@@ -842,7 +842,7 @@ void Test_TemplatedFunctionVariadic(int arg, ...);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 372,
@@ -937,7 +937,7 @@ void Test_TemplatedFunctionVariadic(int arg, ...);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 415,
@@ -1122,7 +1122,7 @@ void Test_TemplatedFunctionVariadic(int arg, ...);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 466,
@@ -1239,7 +1239,7 @@ void Test_TemplatedFunctionVariadic(int arg, ...);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 537,
@@ -1378,7 +1378,7 @@ void Test_TemplatedFunctionVariadic(int arg, ...);
// 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
index 1d67e26fc80c4..cb9bf0faaece6 100644
--- a/clang/test/AST/ast-dump-decl-context-json.cpp
+++ b/clang/test/AST/ast-dump-decl-context-json.cpp
@@ -16,7 +16,7 @@ void S::Method() {}
// 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
index 9bc9064cc11dc..9264590d67b89 100644
--- a/clang/test/AST/ast-dump-decl-json.c
+++ b/clang/test/AST/ast-dump-decl-json.c
@@ -91,7 +91,7 @@ void testParmVarDecl(int TestParmVarDecl);
// 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 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 149,
@@ -165,7 +165,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 186,
@@ -195,7 +195,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 219,
@@ -250,7 +250,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 252,
@@ -360,7 +360,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "LabelDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 344,
@@ -385,7 +385,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "name": "TestLabelDecl"
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "TypedefDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 411,
@@ -421,7 +421,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "EnumDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 434,
@@ -474,7 +474,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 475,
@@ -583,7 +583,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "EnumDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 540,
@@ -607,7 +607,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "name": "TestEnumDeclForward"
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 569,
@@ -662,7 +662,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 606,
@@ -689,7 +689,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "completeDefinition": true
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 639,
@@ -771,7 +771,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 708,
@@ -851,7 +851,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 757,
@@ -876,7 +876,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "tagUsed": "struct"
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 811,
@@ -903,6 +903,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: }
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 835,
@@ -975,6 +976,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 875,
@@ -1106,6 +1108,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1003,
@@ -1280,6 +1283,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1113,
@@ -1450,6 +1454,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1168,
@@ -1505,7 +1510,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1203,
@@ -1533,7 +1538,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1241,
@@ -1562,7 +1567,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "storageClass": "extern"
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1274,
@@ -1591,7 +1596,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "inline": true
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1330,
@@ -1618,6 +1623,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: }
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1351,
@@ -1691,6 +1697,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1383,
@@ -1718,7 +1725,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1407,
@@ -1747,7 +1754,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "storageClass": "extern"
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1435,
@@ -1776,6 +1783,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "tls": "static"
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1458,
@@ -1827,6 +1835,7 @@ void testParmVarDecl(int TestParmVarDecl);
// 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
index d21953624887e..b970d73e906be 100644
--- a/clang/test/AST/ast-dump-decl-json.m
+++ b/clang/test/AST/ast-dump-decl-json.m
@@ -85,7 +85,7 @@ void f() {
// 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 @@ void f() {
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "ObjCImplementationDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 215,
@@ -291,7 +291,7 @@ void f() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "ObjCMethodDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 408,
@@ -349,6 +349,7 @@ void f() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "ObjCMethodDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 490,
@@ -499,6 +500,7 @@ void f() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "ObjCProtocolDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 562,
@@ -553,7 +555,7 @@ void f() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 614,
@@ -626,7 +628,7 @@ void f() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "ObjCImplementationDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 672,
@@ -771,7 +773,7 @@ void f() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "ObjCCategoryDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 737,
@@ -843,7 +845,7 @@ void f() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 809,
@@ -914,7 +916,7 @@ void f() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "ObjCCategoryImplDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 866,
@@ -1032,7 +1034,7 @@ void f() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "ObjCCompatibleAliasDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 926,
@@ -1061,7 +1063,7 @@ void f() {
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 990,
@@ -1339,7 +1341,7 @@ void f() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "ObjCImplementationDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1107,
@@ -1674,6 +1676,7 @@ void f() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1184,
@@ -1959,6 +1962,7 @@ void f() {
// 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
index 46121c3d30b84..1101457e23d6e 100644
--- a/clang/test/AST/ast-dump-enum-json.cpp
+++ b/clang/test/AST/ast-dump-enum-json.cpp
@@ -33,7 +33,7 @@ enum class I : int {
// 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 @@ enum class I : int {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "EnumDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 117,
@@ -189,7 +189,7 @@ enum class I : int {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "EnumDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 146,
@@ -270,7 +270,7 @@ enum class I : int {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "EnumDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 188,
@@ -352,7 +352,7 @@ enum class I : int {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "EnumDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 224,
@@ -434,7 +434,7 @@ enum class I : int {
// 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
index e37c6f17f0416..3e288b9f0e706 100644
--- a/clang/test/AST/ast-dump-expr-json.c
+++ b/clang/test/AST/ast-dump-expr-json.c
@@ -109,7 +109,7 @@ void PrimaryExpressions(int a) {
// 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 @@ void PrimaryExpressions(int a) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 151,
@@ -529,7 +529,7 @@ void PrimaryExpressions(int a) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 199,
@@ -963,7 +963,7 @@ void PrimaryExpressions(int a) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 252,
@@ -3335,7 +3335,7 @@ void PrimaryExpressions(int a) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 646,
@@ -4003,7 +4003,7 @@ void PrimaryExpressions(int a) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 861,
@@ -4900,7 +4900,7 @@ void PrimaryExpressions(int a) {
// 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
index 16fb7814dfc7d..b9c66b0fc90ec 100644
--- a/clang/test/AST/ast-dump-expr-json.cpp
+++ b/clang/test/AST/ast-dump-expr-json.cpp
@@ -155,6 +155,7 @@ void TestNonADLCall3() {
// 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 @@ void TestNonADLCall3() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 995,
@@ -1016,6 +1018,7 @@ void TestNonADLCall3() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1149,
@@ -1402,6 +1405,7 @@ void TestNonADLCall3() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1326,
@@ -2479,6 +2483,7 @@ void TestNonADLCall3() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1541,
@@ -3555,6 +3560,7 @@ void TestNonADLCall3() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1841,
@@ -7753,6 +7759,7 @@ void TestNonADLCall3() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 2336,
@@ -8190,6 +8197,7 @@ void TestNonADLCall3() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 2387,
@@ -8470,6 +8478,7 @@ void TestNonADLCall3() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 2437,
@@ -8952,6 +8961,7 @@ void TestNonADLCall3() {
// 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
index 9004a33c1ae94..9b30c5957e3b3 100644
--- a/clang/test/AST/ast-dump-expr-json.m
+++ b/clang/test/AST/ast-dump-expr-json.m
@@ -97,6 +97,7 @@ void TestObjCBoolLiteral() {
// 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 @@ void TestObjCBoolLiteral() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1574,
@@ -421,6 +423,7 @@ void TestObjCBoolLiteral() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1640,
@@ -582,6 +585,7 @@ void TestObjCBoolLiteral() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1678,
@@ -705,6 +709,7 @@ void TestObjCBoolLiteral() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1737,
@@ -891,6 +896,7 @@ void TestObjCBoolLiteral() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1817,
@@ -1913,6 +1919,7 @@ void TestObjCBoolLiteral() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1892,
@@ -4760,6 +4767,7 @@ void TestObjCBoolLiteral() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 2060,
@@ -4964,6 +4972,7 @@ void TestObjCBoolLiteral() {
// 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
index 89807cb8274ed..e2bc038b462e7 100644
--- 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 d;
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
index 1e266938a3802..aeaf3540a9875 100644
--- a/clang/test/AST/ast-dump-funcs-json.cpp
+++ b/clang/test/AST/ast-dump-funcs-json.cpp
@@ -43,7 +43,7 @@ int main() {
// 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 @@ int main() {
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 140,
@@ -99,7 +99,7 @@ int main() {
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 162,
@@ -127,7 +127,7 @@ int main() {
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 187,
@@ -155,7 +155,7 @@ int main() {
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 205,
@@ -183,6 +183,7 @@ int main() {
// CHECK-NEXT: }
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 232,
@@ -285,6 +286,7 @@ int main() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 271,
@@ -314,6 +316,7 @@ int main() {
// CHECK-NEXT: "pure": true
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 343,
@@ -431,6 +434,7 @@ int main() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 399,
@@ -458,7 +462,7 @@ int main() {
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 419,
@@ -506,7 +510,7 @@ int main() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 446,
@@ -535,7 +539,7 @@ int main() {
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 460,
@@ -563,7 +567,7 @@ int main() {
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 478,
@@ -645,6 +649,7 @@ int main() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 504,
@@ -750,6 +755,7 @@ int main() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 545,
@@ -778,7 +784,7 @@ int main() {
// CHECK-NEXT: "constexpr": true
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 570,
@@ -807,7 +813,7 @@ int main() {
// CHECK-NEXT: "storageClass": "static"
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 595,
@@ -836,7 +842,7 @@ int main() {
// CHECK-NEXT: "storageClass": "extern"
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 620,
@@ -865,7 +871,7 @@ int main() {
// CHECK-NEXT: "inline": true
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 638,
@@ -893,7 +899,7 @@ int main() {
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 665,
@@ -921,7 +927,7 @@ int main() {
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 700,
@@ -949,7 +955,7 @@ int main() {
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 751,
@@ -1056,7 +1062,7 @@ int main() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 769,
@@ -1126,7 +1132,7 @@ int main() {
// 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
index e9966856b7d41..6c8065b54e336 100644
--- a/clang/test/AST/ast-dump-if-json.cpp
+++ b/clang/test/AST/ast-dump-if-json.cpp
@@ -38,6 +38,7 @@ void func(int val) {
// using --filters=IfStmt
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -150,6 +151,7 @@ void func(int val) {
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -280,6 +282,7 @@ void func(int val) {
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -523,6 +526,7 @@ void func(int val) {
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -650,6 +654,7 @@ void func(int val) {
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -832,6 +837,7 @@ void func(int val) {
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -1014,6 +1020,7 @@ void func(int val) {
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -1050,6 +1057,7 @@ void func(int val) {
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -1103,6 +1111,7 @@ void func(int val) {
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -1140,6 +1149,7 @@ void func(int val) {
// 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
index 340140abb66dc..85a0a2a73e30e 100644
--- a/clang/test/AST/ast-dump-macro-json.c
+++ b/clang/test/AST/ast-dump-macro-json.c
@@ -19,7 +19,7 @@ void BLAP(foo, __COUNTER__)(void);
// 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 @@ void BLAP(foo, __COUNTER__)(void);
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "spellingLoc": {
@@ -91,7 +91,7 @@ void BLAP(foo, __COUNTER__)(void);
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "spellingLoc": {
@@ -126,7 +126,7 @@ void BLAP(foo, __COUNTER__)(void);
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "spellingLoc": {
@@ -163,7 +163,7 @@ void BLAP(foo, __COUNTER__)(void);
// 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
index 9680195364e6a..7b69591d8e856 100644
--- a/clang/test/AST/ast-dump-namespace-json.cpp
+++ b/clang/test/AST/ast-dump-namespace-json.cpp
@@ -20,7 +20,7 @@ namespace quux::inline frobble {
// 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 @@ namespace quux::inline frobble {
// CHECK-NEXT: "name": "foo"
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "NamespaceDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 117,
@@ -68,12 +68,12 @@ namespace quux::inline frobble {
// 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 @@ namespace quux::inline frobble {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "NamespaceDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 176,
@@ -174,7 +174,7 @@ namespace quux::inline frobble {
// 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
index aeaa02c1afb41..626f3a5bb28cb 100644
--- 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 @@ struct DoesNotAllowConstDefaultInit {
// 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 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 190,
@@ -719,7 +719,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 212,
@@ -862,7 +862,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 303,
@@ -1003,7 +1003,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 396,
@@ -1107,7 +1107,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 417,
@@ -1232,7 +1232,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 450,
@@ -1357,7 +1357,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 484,
@@ -1503,7 +1503,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 530,
@@ -1634,7 +1634,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 572,
@@ -1899,7 +1899,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 625,
@@ -2003,7 +2003,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 658,
@@ -2156,7 +2156,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 753,
@@ -2281,7 +2281,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 781,
@@ -2402,7 +2402,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 813,
@@ -2535,7 +2535,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 861,
@@ -2680,7 +2680,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 907,
@@ -2945,7 +2945,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 954,
@@ -3076,7 +3076,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 996,
@@ -3343,7 +3343,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1044,
@@ -3608,7 +3608,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1091,
@@ -3729,7 +3729,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1140,
@@ -3862,7 +3862,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1187,
@@ -4007,7 +4007,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1261,
@@ -4111,7 +4111,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1303,
@@ -4260,7 +4260,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1403,
@@ -4405,7 +4405,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1497,
@@ -4533,7 +4533,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1544,
@@ -4658,7 +4658,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1585,
@@ -4908,7 +4908,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1642,
@@ -5012,6 +5012,7 @@ struct DoesNotAllowConstDefaultInit {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1675,
@@ -5162,6 +5163,7 @@ struct DoesNotAllowConstDefaultInit {
// 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
index 1024bfe4053f6..2227a1fa33e0a 100644
--- a/clang/test/AST/ast-dump-records-json.cpp
+++ b/clang/test/AST/ast-dump-records-json.cpp
@@ -87,17 +87,17 @@ struct Derived6 : virtual public Bases... {
// 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 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "tagUsed": "struct"
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 112,
@@ -147,6 +147,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "tagUsed": "struct"
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 123,
@@ -567,6 +568,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 206,
@@ -1191,7 +1193,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 321,
@@ -1368,7 +1370,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 368,
@@ -1392,7 +1394,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "tagUsed": "union"
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 378,
@@ -1416,6 +1418,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: "tagUsed": "union"
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 388,
@@ -1837,6 +1840,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 470,
@@ -2461,7 +2465,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 585,
@@ -2702,7 +2706,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 602,
@@ -2943,7 +2947,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 619,
@@ -3184,7 +3188,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 637,
@@ -3296,7 +3300,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 667,
@@ -3407,7 +3411,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 705,
@@ -3646,7 +3650,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 743,
@@ -3899,7 +3903,7 @@ struct Derived6 : virtual public Bases... {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 805,
@@ -4138,7 +4142,7 @@ struct Derived6 : virtual public Bases... {
// 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
index 85e625549384f..fe3ec558112a6 100644
--- a/clang/test/AST/ast-dump-stmt-json.c
+++ b/clang/test/AST/ast-dump-stmt-json.c
@@ -150,6 +150,7 @@ void TestLineNumbers(void) {
// 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 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 121,
@@ -317,6 +319,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -476,6 +479,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 198,
@@ -655,6 +659,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -1297,6 +1302,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -2053,6 +2059,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -2335,6 +2342,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -2831,6 +2839,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -3613,6 +3622,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -4820,6 +4830,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -5064,6 +5075,7 @@ void TestLineNumbers(void) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -5244,6 +5256,7 @@ void TestLineNumbers(void) {
// 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
index c2ccc9acb7a89..6c357b4491922 100644
--- a/clang/test/AST/ast-dump-stmt-json.cpp
+++ b/clang/test/AST/ast-dump-stmt-json.cpp
@@ -125,7 +125,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// 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 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "UsingDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 164,
@@ -194,7 +194,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "name": "n::function"
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "UsingShadowDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 164,
@@ -224,7 +224,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: }
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "UsingDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 183,
@@ -247,7 +247,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: "name": "n::Variable"
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "UsingShadowDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 183,
@@ -277,6 +277,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: }
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 198,
@@ -510,6 +511,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 266,
@@ -661,7 +663,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 323,
@@ -790,6 +792,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 378,
@@ -1422,6 +1425,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
@@ -1479,7 +1483,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
@@ -1558,7 +1562,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
@@ -1616,7 +1620,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
@@ -1695,7 +1699,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
@@ -1735,7 +1739,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
@@ -1787,7 +1791,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
@@ -1827,7 +1831,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
@@ -1879,6 +1883,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 598,
@@ -2101,6 +2106,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 766,
@@ -2607,6 +2613,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1049,
@@ -2873,6 +2880,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1214,
@@ -3071,6 +3079,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1261,
@@ -3281,6 +3290,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1315,
@@ -3964,6 +3974,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 1529,
@@ -6649,6 +6660,7 @@ void TestDependentGenericSelectionExpr(Ty T) {
// 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
index d35faacc6e141..44935d832674b 100644
--- a/clang/test/AST/ast-dump-stmt-json.m
+++ b/clang/test/AST/ast-dump-stmt-json.m
@@ -21,6 +21,7 @@ void TestObjCAtCatchStmt() {
// 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 @@ void TestObjCAtCatchStmt() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 185,
@@ -485,6 +487,7 @@ void TestObjCAtCatchStmt() {
// 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
index 388acfa42a55b..e3342190ff919 100644
--- a/clang/test/AST/ast-dump-template-decls-json.cpp
+++ b/clang/test/AST/ast-dump-template-decls-json.cpp
@@ -60,6 +60,7 @@ void i();
// 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
index e0d9768a2cb10..1efa5262d1756 100644
--- a/clang/test/AST/ast-dump-temporaries-json.cpp
+++ b/clang/test/AST/ast-dump-temporaries-json.cpp
@@ -21,6 +21,7 @@ void MaterializeTemp() {
// 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 @@ void MaterializeTemp() {
// CHECK-NEXT: ]
// CHECK-NEXT: }
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "ExprWithCleanups",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
@@ -251,6 +253,7 @@ void MaterializeTemp() {
// 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
index 36cbb92e32911..6159d595f82de 100644
--- a/clang/test/AST/ast-dump-types-json.cpp
+++ b/clang/test/AST/ast-dump-types-json.cpp
@@ -27,7 +27,7 @@ using ::TestUsingShadowDeclType;
// 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 @@ using ::TestUsingShadowDeclType;
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "TypedefDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 239,
@@ -130,7 +130,7 @@ using ::TestUsingShadowDeclType;
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "TypedefDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 319,
@@ -239,7 +239,7 @@ using ::TestUsingShadowDeclType;
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "TypedefDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 366,
@@ -316,7 +316,7 @@ using ::TestUsingShadowDeclType;
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "TypedefDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 416,
@@ -374,7 +374,7 @@ using ::TestUsingShadowDeclType;
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "TypedefDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 456,
@@ -446,7 +446,7 @@ using ::TestUsingShadowDeclType;
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
+// CHECK-NOT: {{^}}Dumping
// CHECK: "kind": "TypedefDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "offset": 506,
@@ -482,7 +482,7 @@ using ::TestUsingShadowDeclType;
// 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
index f783c79faef86..e6720485b3bf7 100644
--- 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 @@ def normalize(dict_var):
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 @@ def normalize(dict_var):
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 @@ def process_file(source_file, clang_binary, cmdline_filters, cmdline_opts,
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 @@ def process_file(source_file, clang_binary, cmdline_filters, cmdline_opts,
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:
More information about the cfe-commits
mailing list