From 1fffe8d6eede5afedb6da94443229657df724d22 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 20 Jun 2019 16:22:35 +0000 Subject: [PATCH] Dump more information about expressions involving temporaries when dumping the AST to JSON. llvm-svn: 363943 --- clang/include/clang/AST/JSONNodeDumper.h | 3 + clang/lib/AST/JSONNodeDumper.cpp | 45 ++ clang/test/AST/ast-dump-decl-json.m | 9 +- clang/test/AST/ast-dump-stmt-json.m | 15 +- clang/test/AST/ast-dump-temporaries-json.cpp | 446 +++++++++++++++++++ 5 files changed, 516 insertions(+), 2 deletions(-) create mode 100644 clang/test/AST/ast-dump-temporaries-json.cpp diff --git a/clang/include/clang/AST/JSONNodeDumper.h b/clang/include/clang/AST/JSONNodeDumper.h index 4ed3c4bda218..ce39ffb6b0b5 100644 --- a/clang/include/clang/AST/JSONNodeDumper.h +++ b/clang/include/clang/AST/JSONNodeDumper.h @@ -255,6 +255,9 @@ public: void VisitGenericSelectionExpr(const GenericSelectionExpr *GSE); void VisitCXXUnresolvedConstructExpr(const CXXUnresolvedConstructExpr *UCE); void VisitCXXConstructExpr(const CXXConstructExpr *CE); + void VisitExprWithCleanups(const ExprWithCleanups *EWC); + void VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *BTE); + void VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *MTE); void VisitIntegerLiteral(const IntegerLiteral *IL); void VisitCharacterLiteral(const CharacterLiteral *CL); diff --git a/clang/lib/AST/JSONNodeDumper.cpp b/clang/lib/AST/JSONNodeDumper.cpp index 15e198db46fc..24d44cfafe4c 100644 --- a/clang/lib/AST/JSONNodeDumper.cpp +++ b/clang/lib/AST/JSONNodeDumper.cpp @@ -1026,6 +1026,51 @@ void JSONNodeDumper::VisitCXXConstructExpr(const CXXConstructExpr *CE) { } } +void JSONNodeDumper::VisitExprWithCleanups(const ExprWithCleanups *EWC) { + attributeOnlyIfTrue("cleanupsHaveSideEffects", + EWC->cleanupsHaveSideEffects()); + if (EWC->getNumObjects()) { + JOS.attributeArray("cleanups", [this, EWC] { + for (const ExprWithCleanups::CleanupObject &CO : EWC->getObjects()) + JOS.value(createBareDeclRef(CO)); + }); + } +} + +void JSONNodeDumper::VisitCXXBindTemporaryExpr( + const CXXBindTemporaryExpr *BTE) { + const CXXTemporary *Temp = BTE->getTemporary(); + JOS.attribute("temp", createPointerRepresentation(Temp)); + if (const CXXDestructorDecl *Dtor = Temp->getDestructor()) + JOS.attribute("dtor", createBareDeclRef(Dtor)); +} + +void JSONNodeDumper::VisitMaterializeTemporaryExpr( + const MaterializeTemporaryExpr *MTE) { + if (const ValueDecl *VD = MTE->getExtendingDecl()) + JOS.attribute("extendingDecl", createBareDeclRef(VD)); + + switch (MTE->getStorageDuration()) { + case SD_Automatic: + JOS.attribute("storageDuration", "automatic"); + break; + case SD_Dynamic: + JOS.attribute("storageDuration", "dynamic"); + break; + case SD_FullExpression: + JOS.attribute("storageDuration", "full expression"); + break; + case SD_Static: + JOS.attribute("storageDuration", "static"); + break; + case SD_Thread: + JOS.attribute("storageDuration", "thread"); + break; + } + + attributeOnlyIfTrue("boundToLValueRef", MTE->isBoundToLvalueReference()); +} + void JSONNodeDumper::VisitIntegerLiteral(const IntegerLiteral *IL) { JOS.attribute("value", IL->getValue().toString( diff --git a/clang/test/AST/ast-dump-decl-json.m b/clang/test/AST/ast-dump-decl-json.m index 1c816f3111ba..88d306c70efe 100644 --- a/clang/test/AST/ast-dump-decl-json.m +++ b/clang/test/AST/ast-dump-decl-json.m @@ -83,6 +83,7 @@ void f() { __typeof__(B.foo) Test; } + // CHECK: "kind": "ObjCInterfaceDecl", // CHECK-NEXT: "loc": { // CHECK-NEXT: "col": 12, @@ -1492,6 +1493,13 @@ void f() { // CHECK-NEXT: "qualType": "void (^)(int, ...)" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "rvalue", +// CHECK-NEXT: "cleanupsHaveSideEffects": true, +// CHECK-NEXT: "cleanups": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "BlockDecl" +// CHECK-NEXT: } +// CHECK-NEXT: ], // CHECK-NEXT: "inner": [ // CHECK-NEXT: { // CHECK-NEXT: "id": "0x{{.*}}", @@ -1701,4 +1709,3 @@ void f() { // CHECK-NEXT: "qualType": "typeof (B.foo)" // CHECK-NEXT: } // CHECK-NEXT: } - diff --git a/clang/test/AST/ast-dump-stmt-json.m b/clang/test/AST/ast-dump-stmt-json.m index 0aee71c24400..9647f4a78c1c 100644 --- a/clang/test/AST/ast-dump-stmt-json.m +++ b/clang/test/AST/ast-dump-stmt-json.m @@ -104,6 +104,13 @@ void TestObjCAtCatchStmt() { // CHECK-NEXT: "qualType": "void (^)(void)" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "rvalue", +// CHECK-NEXT: "cleanupsHaveSideEffects": true, +// CHECK-NEXT: "cleanups": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "BlockDecl" +// CHECK-NEXT: } +// CHECK-NEXT: ], // CHECK-NEXT: "inner": [ // CHECK-NEXT: { // CHECK-NEXT: "id": "0x{{.*}}", @@ -322,6 +329,13 @@ void TestObjCAtCatchStmt() { // CHECK-NEXT: "qualType": "void (^)(void)" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "rvalue", +// CHECK-NEXT: "cleanupsHaveSideEffects": true, +// CHECK-NEXT: "cleanups": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "BlockDecl" +// CHECK-NEXT: } +// CHECK-NEXT: ], // CHECK-NEXT: "inner": [ // CHECK-NEXT: { // CHECK-NEXT: "id": "0x{{.*}}", @@ -716,4 +730,3 @@ void TestObjCAtCatchStmt() { // CHECK-NEXT: } // CHECK-NEXT: ] // CHECK-NEXT: } - diff --git a/clang/test/AST/ast-dump-temporaries-json.cpp b/clang/test/AST/ast-dump-temporaries-json.cpp new file mode 100644 index 000000000000..dbd6f29fd068 --- /dev/null +++ b/clang/test/AST/ast-dump-temporaries-json.cpp @@ -0,0 +1,446 @@ +// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsyntax-only -ast-dump=json %s | FileCheck %s + +struct S { + S() {} + ~S() {} +}; + +void func(const int &); + +void BindTemp() { + const S &s = S(); +} + +void MaterializeTemp() { + const int &i = 1.0; + + float f = 1.0f; + func(f); +} + + + +// CHECK: "kind": "ExprWithCleanups", +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 16, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 11 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 18, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 11 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "const S" +// CHECK-NEXT: }, +// CHECK-NEXT: "valueCategory": "lvalue", +// CHECK-NEXT: "cleanupsHaveSideEffects": true, +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "MaterializeTemporaryExpr", +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 16, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 11 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 18, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 11 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "const S" +// CHECK-NEXT: }, +// CHECK-NEXT: "valueCategory": "lvalue", +// CHECK-NEXT: "extendingDecl": { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "VarDecl", +// CHECK-NEXT: "name": "s", +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "const S &" +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "storageDuration": "automatic", +// CHECK-NEXT: "boundToLValueRef": true, +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "ImplicitCastExpr", +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 16, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 11 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 18, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 11 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "const S" +// CHECK-NEXT: }, +// CHECK-NEXT: "valueCategory": "rvalue", +// CHECK-NEXT: "castKind": "NoOp", +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "CXXBindTemporaryExpr", +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 16, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 11 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 18, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 11 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "S" +// CHECK-NEXT: }, +// CHECK-NEXT: "valueCategory": "rvalue", +// CHECK-NEXT: "temp": "0x{{.*}}", +// CHECK-NEXT: "dtor": { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "CXXDestructorDecl", +// CHECK-NEXT: "name": "~S", +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "void () noexcept" +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "CXXTemporaryObjectExpr", +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 16, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 11 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 18, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 11 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "S" +// CHECK-NEXT: }, +// CHECK-NEXT: "valueCategory": "rvalue", +// CHECK-NEXT: "ctorType": { +// CHECK-NEXT: "qualType": "void ()" +// CHECK-NEXT: }, +// CHECK-NEXT: "hadMultipleCandidates": true, +// CHECK-NEXT: "constructionKind": "complete" +// CHECK-NEXT: } +// CHECK-NEXT: ] +// CHECK-NEXT: } +// CHECK-NEXT: ] +// CHECK-NEXT: } +// CHECK-NEXT: ] +// CHECK-NEXT: } +// CHECK-NEXT: ] +// CHECK-NEXT: } + + +// CHECK: "kind": "ExprWithCleanups", +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 18, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 15 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 18, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 15 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "const int" +// CHECK-NEXT: }, +// CHECK-NEXT: "valueCategory": "lvalue", +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "MaterializeTemporaryExpr", +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 18, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 15 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 18, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 15 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "const int" +// CHECK-NEXT: }, +// CHECK-NEXT: "valueCategory": "lvalue", +// CHECK-NEXT: "extendingDecl": { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "VarDecl", +// CHECK-NEXT: "name": "i", +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "const int &" +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "storageDuration": "automatic", +// CHECK-NEXT: "boundToLValueRef": true, +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "ImplicitCastExpr", +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 18, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 15 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 18, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 15 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "const int" +// CHECK-NEXT: }, +// CHECK-NEXT: "valueCategory": "rvalue", +// CHECK-NEXT: "castKind": "FloatingToIntegral", +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "FloatingLiteral", +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 18, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 15 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 18, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 15 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "double" +// CHECK-NEXT: }, +// CHECK-NEXT: "valueCategory": "rvalue", +// CHECK-NEXT: "value": 1 +// CHECK-NEXT: } +// CHECK-NEXT: ] +// CHECK-NEXT: } +// CHECK-NEXT: ] +// CHECK-NEXT: } +// CHECK-NEXT: ] +// CHECK-NEXT: } + + +// CHECK: "kind": "ExprWithCleanups", +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 9, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "void" +// CHECK-NEXT: }, +// CHECK-NEXT: "valueCategory": "rvalue", +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "CallExpr", +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 9, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "void" +// CHECK-NEXT: }, +// CHECK-NEXT: "valueCategory": "rvalue", +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "ImplicitCastExpr", +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "void (*)(const int &)" +// CHECK-NEXT: }, +// CHECK-NEXT: "valueCategory": "rvalue", +// CHECK-NEXT: "castKind": "FunctionToPointerDecay", +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "DeclRefExpr", +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "void (const int &)" +// CHECK-NEXT: }, +// CHECK-NEXT: "valueCategory": "lvalue", +// CHECK-NEXT: "referencedDecl": { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "FunctionDecl", +// CHECK-NEXT: "name": "func", +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "void (const int &)" +// CHECK-NEXT: } +// CHECK-NEXT: } +// CHECK-NEXT: } +// CHECK-NEXT: ] +// CHECK-NEXT: }, +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "MaterializeTemporaryExpr", +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 8, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 8, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "const int" +// CHECK-NEXT: }, +// CHECK-NEXT: "valueCategory": "lvalue", +// CHECK-NEXT: "storageDuration": "full expression", +// CHECK-NEXT: "boundToLValueRef": true, +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "ImplicitCastExpr", +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 8, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 8, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "const int" +// CHECK-NEXT: }, +// CHECK-NEXT: "valueCategory": "rvalue", +// CHECK-NEXT: "castKind": "FloatingToIntegral", +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "ImplicitCastExpr", +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 8, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 8, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "float" +// CHECK-NEXT: }, +// CHECK-NEXT: "valueCategory": "rvalue", +// CHECK-NEXT: "castKind": "LValueToRValue", +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "DeclRefExpr", +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 8, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 8, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "float" +// CHECK-NEXT: }, +// CHECK-NEXT: "valueCategory": "lvalue", +// CHECK-NEXT: "referencedDecl": { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "VarDecl", +// CHECK-NEXT: "name": "f", +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "float" +// CHECK-NEXT: } +// CHECK-NEXT: } +// CHECK-NEXT: } +// CHECK-NEXT: ] +// CHECK-NEXT: } +// CHECK-NEXT: ] +// CHECK-NEXT: } +// CHECK-NEXT: ] +// CHECK-NEXT: } +// CHECK-NEXT: ] +// CHECK-NEXT: } +// CHECK-NEXT: ] +// CHECK-NEXT: } +