Expose more statement, expression, and declaration kinds in libclang,
from Manuel Holtgrewe!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141200 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Index/annotate-tokens.c b/test/Index/annotate-tokens.c
index 0413c50..0b5f3d4 100644
--- a/test/Index/annotate-tokens.c
+++ b/test/Index/annotate-tokens.c
@@ -38,35 +38,32 @@
// CHECK: Punctuation: "*" [4:4 - 4:5] VarDecl=t_ptr:4:6 (Definition)
// CHECK: Identifier: "t_ptr" [4:6 - 4:11] VarDecl=t_ptr:4:6 (Definition)
// CHECK: Punctuation: "=" [4:12 - 4:13] VarDecl=t_ptr:4:6 (Definition)
-// CHECK: Punctuation: "(" [4:14 - 4:15] UnexposedExpr=
+// CHECK: Punctuation: "(" [4:14 - 4:15] CStyleCastExpr=
// CHECK: Identifier: "T" [4:15 - 4:16] TypeRef=T:1:13
-// CHECK: Punctuation: "*" [4:17 - 4:18] UnexposedExpr=
-// CHECK: Punctuation: ")" [4:18 - 4:19] UnexposedExpr=
// CHECK: Identifier: "ptr" [4:19 - 4:22] DeclRefExpr=ptr:3:14
-// CHECK: Punctuation: ";" [4:22 - 4:23] UnexposedStmt=
-// CHECK: Punctuation: "(" [5:3 - 5:4] UnexposedExpr=
-// CHECK: Keyword: "void" [5:4 - 5:8] UnexposedExpr=
-// CHECK: Punctuation: ")" [5:8 - 5:9] UnexposedExpr=
+// CHECK: Punctuation: ";" [4:22 - 4:23] DeclStmt=
+// CHECK: Punctuation: "(" [5:3 - 5:4] CStyleCastExpr=
+// CHECK: Keyword: "void" [5:4 - 5:8] CStyleCastExpr=
+// CHECK: Punctuation: ")" [5:8 - 5:9] CStyleCastExpr=
// CHECK: Keyword: "sizeof" [5:9 - 5:15] UnexposedExpr=
// CHECK: Punctuation: "(" [5:15 - 5:16] UnexposedExpr=
// CHECK: Identifier: "T" [5:16 - 5:17] TypeRef=T:1:13
// CHECK: Punctuation: ")" [5:17 - 5:18] UnexposedExpr=
-// CHECK: Punctuation: ";" [5:18 - 5:19] UnexposedStmt=
-// CHECK: Comment: "/* A comment */" [6:3 - 6:18] UnexposedStmt=
+// CHECK: Punctuation: ";" [5:18 - 5:19] CompoundStmt=
// CHECK: Keyword: "struct" [7:3 - 7:9] VarDecl=x:7:12 (Definition)
// CHECK: Identifier: "X" [7:10 - 7:11] TypeRef=struct X:2:8
// CHECK: Identifier: "x" [7:12 - 7:13] VarDecl=x:7:12 (Definition)
// CHECK: Punctuation: "=" [7:14 - 7:15] VarDecl=x:7:12 (Definition)
-// CHECK: Punctuation: "(" [7:16 - 7:17] UnexposedExpr=
-// CHECK: Keyword: "struct" [7:17 - 7:23] UnexposedExpr=
+// CHECK: Punctuation: "(" [7:16 - 7:17] CompoundLiteralExpr=
+// CHECK: Keyword: "struct" [7:17 - 7:23] CompoundLiteralExpr=
// CHECK: Identifier: "X" [7:24 - 7:25] TypeRef=struct X:2:8
-// CHECK: Punctuation: ")" [7:25 - 7:26] UnexposedExpr=
-// CHECK: Punctuation: "{" [7:26 - 7:27] UnexposedExpr=
-// CHECK: Literal: "1" [7:27 - 7:28] UnexposedExpr=
-// CHECK: Punctuation: "," [7:28 - 7:29] UnexposedExpr=
-// CHECK: Literal: "2" [7:30 - 7:31] UnexposedExpr=
-// CHECK: Punctuation: "}" [7:31 - 7:32] UnexposedExpr=
-// CHECK: Punctuation: ";" [7:32 - 7:33] UnexposedStmt=
+// CHECK: Punctuation: ")" [7:25 - 7:26] CompoundLiteralExpr=
+// CHECK: Punctuation: "{" [7:26 - 7:27] InitListExpr=
+// CHECK: Literal: "1" [7:27 - 7:28] IntegerLiteral=
+// CHECK: Punctuation: "," [7:28 - 7:29] InitListExpr=
+// CHECK: Literal: "2" [7:30 - 7:31] IntegerLiteral=
+// CHECK: Punctuation: "}" [7:31 - 7:32] InitListExpr=
+// CHECK: Punctuation: ";" [7:32 - 7:33] DeclStmt=
// CHECK: Keyword: "void" [8:3 - 8:7] VarDecl=xx:8:9 (Definition)
// CHECK: Punctuation: "*" [8:8 - 8:9] VarDecl=xx:8:9 (Definition)
// CHECK: Identifier: "xx" [8:9 - 8:11] VarDecl=xx:8:9 (Definition)
@@ -74,17 +71,17 @@
// CHECK: Identifier: "ptr" [8:14 - 8:17] DeclRefExpr=ptr:3:14
// CHECK: Punctuation: "?" [8:18 - 8:19] UnexposedExpr=
// CHECK: Punctuation: ":" [8:20 - 8:21] UnexposedExpr=
-// CHECK: Punctuation: "&" [8:22 - 8:23] UnexposedExpr=
+// CHECK: Punctuation: "&" [8:22 - 8:23] UnaryOperator=
// CHECK: Identifier: "x" [8:23 - 8:24] DeclRefExpr=x:7:12
-// CHECK: Punctuation: ";" [8:24 - 8:25] UnexposedStmt=
-// CHECK: Keyword: "const" [9:3 - 9:8] UnexposedStmt=
+// CHECK: Punctuation: ";" [8:24 - 8:25] DeclStmt=
+// CHECK: Keyword: "const" [9:3 - 9:8] DeclStmt=
// CHECK: Keyword: "char" [9:9 - 9:13] VarDecl=hello:9:16 (Definition)
// CHECK: Punctuation: "*" [9:14 - 9:15] VarDecl=hello:9:16 (Definition)
// CHECK: Identifier: "hello" [9:16 - 9:21] VarDecl=hello:9:16 (Definition)
// CHECK: Punctuation: "=" [9:22 - 9:23] VarDecl=hello:9:16 (Definition)
-// CHECK: Literal: ""Hello"" [9:24 - 9:31] UnexposedExpr=
-// CHECK: Punctuation: ";" [9:31 - 9:32] UnexposedStmt=
-// CHECK: Punctuation: "}" [10:1 - 10:2] UnexposedStmt=
+// CHECK: Literal: ""Hello"" [9:24 - 9:31] StringLiteral=
+// CHECK: Punctuation: ";" [9:31 - 9:32] DeclStmt=
+// CHECK: Punctuation: "}" [10:1 - 10:2] CompoundStmt=
// CHECK: Keyword: "__builtin_va_arg" [15:9 - 15:25] UnexposedExpr=
// CHECK: Identifier: "Int" [15:30 - 15:33] TypeRef=Int:12:13
// CHECK: Keyword: "__builtin_types_compatible_p" [16:9 - 16:37] UnexposedExpr=
@@ -94,15 +91,15 @@
// CHECK: Keyword: "struct" [18:3 - 18:9] VarDecl=x:18:12 (Definition)
// CHECK: Identifier: "X" [18:10 - 18:11] TypeRef=struct X:2:8
// CHECK: Identifier: "x" [18:12 - 18:13] VarDecl=x:18:12 (Definition)
-// CHECK: Keyword: "do" [19:3 - 19:5] UnexposedStmt=
+// CHECK: Keyword: "do" [19:3 - 19:5] DoStmt=
// CHECK: Identifier: "x" [20:5 - 20:6] DeclRefExpr=x:18:12
// CHECK: Punctuation: "." [20:6 - 20:7] MemberRefExpr=a:2:16
// CHECK: Identifier: "a" [20:7 - 20:8] MemberRefExpr=a:2:16
-// CHECK: Punctuation: "++" [20:8 - 20:10] UnexposedExpr=
-// CHECK: Punctuation: ";" [20:10 - 20:11] UnexposedStmt=
-// CHECK: Punctuation: "}" [21:3 - 21:4] UnexposedStmt=
-// CHECK: Keyword: "while" [21:5 - 21:10] UnexposedStmt=
-// CHECK: Punctuation: "(" [21:11 - 21:12] UnexposedStmt=
+// CHECK: Punctuation: "++" [20:8 - 20:10] UnaryOperator=
+// CHECK: Punctuation: ";" [20:10 - 20:11] CompoundStmt=
+// CHECK: Punctuation: "}" [21:3 - 21:4] CompoundStmt=
+// CHECK: Keyword: "while" [21:5 - 21:10] DoStmt=
+// CHECK: Punctuation: "(" [21:11 - 21:12] DoStmt=
// CHECK: Identifier: "x" [21:12 - 21:13] DeclRefExpr=x:18:12
// CHECK: Punctuation: "." [21:13 - 21:14] MemberRefExpr=a:2:16
// CHECK: Identifier: "a" [21:14 - 21:15] MemberRefExpr=a:2:16
@@ -110,30 +107,30 @@
// CHECK: Keyword: "enum" [23:3 - 23:7] VarDecl=c:23:14 (Definition)
// CHECK: Identifier: "Color" [23:8 - 23:13] TypeRef=enum Color:11:6
// CHECK: Identifier: "c" [23:14 - 23:15] VarDecl=c:23:14 (Definition)
-// CHECK: Punctuation: ";" [23:15 - 23:16] UnexposedStmt=
-// CHECK: Keyword: "switch" [24:3 - 24:9] UnexposedStmt=
-// CHECK: Punctuation: "(" [24:10 - 24:11] UnexposedStmt=
+// CHECK: Punctuation: ";" [23:15 - 23:16] DeclStmt=
+// CHECK: Keyword: "switch" [24:3 - 24:9] SwitchStmt=
+// CHECK: Punctuation: "(" [24:10 - 24:11] SwitchStmt=
// CHECK: Identifier: "c" [24:11 - 24:12] DeclRefExpr=c:23:14
-// CHECK: Punctuation: ")" [24:12 - 24:13] UnexposedStmt=
-// CHECK: Punctuation: "{" [24:14 - 24:15] UnexposedStmt=
-// CHECK: Keyword: "case" [25:3 - 25:7] UnexposedStmt=
+// CHECK: Punctuation: ")" [24:12 - 24:13] SwitchStmt=
+// CHECK: Punctuation: "{" [24:14 - 24:15] CompoundStmt=
+// CHECK: Keyword: "case" [25:3 - 25:7] CaseStmt=
// CHECK: Identifier: "Red" [25:8 - 25:11] DeclRefExpr=Red:11:14
-// CHECK: Punctuation: ":" [25:11 - 25:12] UnexposedStmt=
-// CHECK: Keyword: "return" [26:5 - 26:11] UnexposedStmt=
+// CHECK: Punctuation: ":" [25:11 - 25:12] CaseStmt=
+// CHECK: Keyword: "return" [26:5 - 26:11] ReturnStmt=
// CHECK: Identifier: "Green" [26:12 - 26:17] DeclRefExpr=Green:11:19
-// CHECK: Punctuation: ";" [26:17 - 26:18] UnexposedStmt=
-// CHECK: Keyword: "case" [28:3 - 28:7] UnexposedStmt=
+// CHECK: Punctuation: ";" [26:17 - 26:18] CompoundStmt=
+// CHECK: Keyword: "case" [28:3 - 28:7] CaseStmt=
// CHECK: Identifier: "Green" [28:8 - 28:13] DeclRefExpr=Green:11:19
-// CHECK: Punctuation: ":" [28:13 - 28:14] UnexposedStmt=
-// CHECK: Keyword: "return" [29:5 - 29:11] UnexposedStmt=
+// CHECK: Punctuation: ":" [28:13 - 28:14] CaseStmt=
+// CHECK: Keyword: "return" [29:5 - 29:11] ReturnStmt=
// CHECK: Identifier: "Blue" [29:12 - 29:16] DeclRefExpr=Blue:11:26
-// CHECK: Punctuation: ";" [29:16 - 29:17] UnexposedStmt=
-// CHECK: Keyword: "case" [31:3 - 31:7] UnexposedStmt=
+// CHECK: Punctuation: ";" [29:16 - 29:17] CompoundStmt=
+// CHECK: Keyword: "case" [31:3 - 31:7] CaseStmt=
// CHECK: Identifier: "Blue" [31:8 - 31:12] DeclRefExpr=Blue:11:26
-// CHECK: Punctuation: ":" [31:12 - 31:13] UnexposedStmt=
-// CHECK: Keyword: "return" [32:5 - 32:11] UnexposedStmt=
+// CHECK: Punctuation: ":" [31:12 - 31:13] CaseStmt=
+// CHECK: Keyword: "return" [32:5 - 32:11] ReturnStmt=
// CHECK: Identifier: "Red" [32:12 - 32:15] DeclRefExpr=Red:11:14
-// CHECK: Punctuation: ";" [32:15 - 32:16] UnexposedStmt=
+// CHECK: Punctuation: ";" [32:15 - 32:16] CompoundStmt=
// RUN: c-index-test -test-annotate-tokens=%s:4:1:165:32 %s | FileCheck %s
// RUN: c-index-test -test-annotate-tokens=%s:4:1:165:38 %s | FileCheck %s