From: Ted Kremenek Date: Wed, 30 Nov 2011 22:08:08 +0000 (+0000) Subject: Per an offline conversation with John McCall, have StmtPrinter actually print out... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=381c0662095014532bce6706858fd8c4e34da3f7;p=clang Per an offline conversation with John McCall, have StmtPrinter actually print out the source expression for OpaqueValueExpr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145524 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index 807d35875f..220e50a058 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -1616,7 +1616,9 @@ void StmtPrinter::VisitBlockDeclRefExpr(BlockDeclRefExpr *Node) { OS << *Node->getDecl(); } -void StmtPrinter::VisitOpaqueValueExpr(OpaqueValueExpr *Node) {} +void StmtPrinter::VisitOpaqueValueExpr(OpaqueValueExpr *Node) { + PrintExpr(Node->getSourceExpr()); +} void StmtPrinter::VisitAsTypeExpr(AsTypeExpr *Node) { OS << "__builtin_astype("; diff --git a/test/Analysis/temp-obj-dtors-cfg-output.cpp b/test/Analysis/temp-obj-dtors-cfg-output.cpp index 4a16769f85..d3b467bf4f 100644 --- a/test/Analysis/temp-obj-dtors-cfg-output.cpp +++ b/test/Analysis/temp-obj-dtors-cfg-output.cpp @@ -521,7 +521,7 @@ TestCtorInits::TestCtorInits() // CHECK: Predecessors (2): B5 B6 // CHECK: Successors (2): B2 B3 // CHECK: [ B5 ] -// CHECK: 1: +// CHECK: 1: [B7.2] // CHECK: 2: [B5.1] // CHECK: 3: [B5.2] // CHECK: 4: [B5.3] (BindTemporary) @@ -538,7 +538,7 @@ TestCtorInits::TestCtorInits() // CHECK: [ B7 ] // CHECK: 1: A() // CHECK: 2: [B7.1] (BindTemporary) -// CHECK: 3: .operator _Bool +// CHECK: 3: [B7.2].operator _Bool // CHECK: 4: [B7.3]() // CHECK: 5: [B7.4] // CHECK: T: [B7.5] ? ... : ... @@ -576,7 +576,7 @@ TestCtorInits::TestCtorInits() // CHECK: Predecessors (2): B5 B6 // CHECK: Successors (2): B2 B3 // CHECK: [ B5 ] -// CHECK: 1: +// CHECK: 1: [B7.3] // CHECK: 2: [B5.1] // CHECK: 3: [B5.2] // CHECK: 4: [B5.3] (BindTemporary) @@ -594,7 +594,7 @@ TestCtorInits::TestCtorInits() // CHECK: 1: ~A() (Temporary object destructor) // CHECK: 2: A() // CHECK: 3: [B7.2] (BindTemporary) -// CHECK: 4: .operator _Bool +// CHECK: 4: [B7.3].operator _Bool // CHECK: 5: [B7.4]() // CHECK: 6: [B7.5] // CHECK: T: [B7.6] ? ... : ... @@ -613,7 +613,7 @@ TestCtorInits::TestCtorInits() // CHECK: Predecessors (2): B10 B11 // CHECK: Successors (2): B7 B8 // CHECK: [ B10 ] -// CHECK: 1: +// CHECK: 1: [B12.2] // CHECK: 2: [B10.1] // CHECK: 3: [B10.2] // CHECK: 4: [B10.3] (BindTemporary) @@ -630,7 +630,7 @@ TestCtorInits::TestCtorInits() // CHECK: [ B12 ] // CHECK: 1: A() // CHECK: 2: [B12.1] (BindTemporary) -// CHECK: 3: .operator _Bool +// CHECK: 3: [B12.2].operator _Bool // CHECK: 4: [B12.3]() // CHECK: 5: [B12.4] // CHECK: T: [B12.5] ? ... : ... @@ -773,3 +773,4 @@ TestCtorInits::TestCtorInits() // CHECK: [ B0 (EXIT) ] // CHECK: Predecessors (1): B1 // CHECK: Successors (0): +