steveire created this revision. steveire added a reviewer: aaron.ballman. Herald added a subscriber: cfe-commits.
Repository: rC Clang https://reviews.llvm.org/D55395 Files: lib/AST/ASTDumper.cpp test/AST/dump.cpp Index: test/AST/dump.cpp =================================================================== --- test/AST/dump.cpp +++ test/AST/dump.cpp @@ -29,10 +29,6 @@ // CHECK-NEXT: | |-VarDecl {{.+}} <col:40> col:40 implicit used omp_in 'char' // CHECK-NEXT: | `-VarDecl {{.+}} <col:40> col:40 implicit used omp_out 'char' // CHECK-NEXT: |-OMPDeclareReductionDecl {{.+}} <line:[[@LINE-17]]:37> col:37 fun 'float' combiner initializer -// CHECK-NEXT: | |-CompoundAssignOperator {{.+}} <col:45, col:56> 'float' lvalue '+=' ComputeLHSTy='float' ComputeResultTy='float' -// CHECK-NEXT: | | |-DeclRefExpr {{.+}} <col:45> 'float' lvalue Var {{.+}} 'omp_out' 'float' -// CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} <col:56> 'float' <LValueToRValue> -// CHECK-NEXT: | | `-DeclRefExpr {{.+}} <col:56> 'float' lvalue Var {{.+}} 'omp_in' 'float' // CHECK-NEXT: | |-BinaryOperator {{.+}} <col:76, col:98> 'float' lvalue '=' // CHECK-NEXT: | | |-DeclRefExpr {{.+}} <col:76> 'float' lvalue Var {{.+}} 'omp_priv' 'float' // CHECK-NEXT: | | `-BinaryOperator {{.+}} <col:87, col:98> 'float' '+' @@ -40,6 +36,10 @@ // CHECK-NEXT: | | | `-DeclRefExpr {{.+}} <col:87> 'float' lvalue Var {{.+}} 'omp_orig' 'float' // CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} <col:98> 'float' <IntegralToFloating> // CHECK-NEXT: | | `-IntegerLiteral {{.+}} <col:98> 'int' 15 +// CHECK-NEXT: | |-CompoundAssignOperator {{.+}} <col:45, col:56> 'float' lvalue '+=' ComputeLHSTy='float' ComputeResultTy='float' +// CHECK-NEXT: | | |-DeclRefExpr {{.+}} <col:45> 'float' lvalue Var {{.+}} 'omp_out' 'float' +// CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} <col:56> 'float' <LValueToRValue> +// CHECK-NEXT: | | `-DeclRefExpr {{.+}} <col:56> 'float' lvalue Var {{.+}} 'omp_in' 'float' struct S { int a, b; Index: lib/AST/ASTDumper.cpp =================================================================== --- lib/AST/ASTDumper.cpp +++ lib/AST/ASTDumper.cpp @@ -1074,7 +1074,6 @@ NodeDumper.dumpName(D); NodeDumper.dumpType(D->getType()); OS << " combiner"; - dumpStmt(D->getCombiner()); if (auto *Initializer = D->getInitializer()) { OS << " initializer"; switch (D->getInitializerKind()) { @@ -1089,6 +1088,7 @@ } dumpStmt(Initializer); } + dumpStmt(D->getCombiner()); } void ASTDumper::VisitOMPRequiresDecl(const OMPRequiresDecl *D) {
Index: test/AST/dump.cpp =================================================================== --- test/AST/dump.cpp +++ test/AST/dump.cpp @@ -29,10 +29,6 @@ // CHECK-NEXT: | |-VarDecl {{.+}} <col:40> col:40 implicit used omp_in 'char' // CHECK-NEXT: | `-VarDecl {{.+}} <col:40> col:40 implicit used omp_out 'char' // CHECK-NEXT: |-OMPDeclareReductionDecl {{.+}} <line:[[@LINE-17]]:37> col:37 fun 'float' combiner initializer -// CHECK-NEXT: | |-CompoundAssignOperator {{.+}} <col:45, col:56> 'float' lvalue '+=' ComputeLHSTy='float' ComputeResultTy='float' -// CHECK-NEXT: | | |-DeclRefExpr {{.+}} <col:45> 'float' lvalue Var {{.+}} 'omp_out' 'float' -// CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} <col:56> 'float' <LValueToRValue> -// CHECK-NEXT: | | `-DeclRefExpr {{.+}} <col:56> 'float' lvalue Var {{.+}} 'omp_in' 'float' // CHECK-NEXT: | |-BinaryOperator {{.+}} <col:76, col:98> 'float' lvalue '=' // CHECK-NEXT: | | |-DeclRefExpr {{.+}} <col:76> 'float' lvalue Var {{.+}} 'omp_priv' 'float' // CHECK-NEXT: | | `-BinaryOperator {{.+}} <col:87, col:98> 'float' '+' @@ -40,6 +36,10 @@ // CHECK-NEXT: | | | `-DeclRefExpr {{.+}} <col:87> 'float' lvalue Var {{.+}} 'omp_orig' 'float' // CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} <col:98> 'float' <IntegralToFloating> // CHECK-NEXT: | | `-IntegerLiteral {{.+}} <col:98> 'int' 15 +// CHECK-NEXT: | |-CompoundAssignOperator {{.+}} <col:45, col:56> 'float' lvalue '+=' ComputeLHSTy='float' ComputeResultTy='float' +// CHECK-NEXT: | | |-DeclRefExpr {{.+}} <col:45> 'float' lvalue Var {{.+}} 'omp_out' 'float' +// CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} <col:56> 'float' <LValueToRValue> +// CHECK-NEXT: | | `-DeclRefExpr {{.+}} <col:56> 'float' lvalue Var {{.+}} 'omp_in' 'float' struct S { int a, b; Index: lib/AST/ASTDumper.cpp =================================================================== --- lib/AST/ASTDumper.cpp +++ lib/AST/ASTDumper.cpp @@ -1074,7 +1074,6 @@ NodeDumper.dumpName(D); NodeDumper.dumpType(D->getType()); OS << " combiner"; - dumpStmt(D->getCombiner()); if (auto *Initializer = D->getInitializer()) { OS << " initializer"; switch (D->getInitializerKind()) { @@ -1089,6 +1088,7 @@ } dumpStmt(Initializer); } + dumpStmt(D->getCombiner()); } void ASTDumper::VisitOMPRequiresDecl(const OMPRequiresDecl *D) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits