From: Stephen Kelly Date: Mon, 10 Dec 2018 20:53:39 +0000 (+0000) Subject: Re-order content in OMPDeclareReductionDecl dump X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ea504fb0ea0b7e95f97e0f164651cc1d61629795;p=clang Re-order content in OMPDeclareReductionDecl dump Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55395 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348795 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTDumper.cpp b/lib/AST/ASTDumper.cpp index 1a79137adb..2c128f4943 100644 --- a/lib/AST/ASTDumper.cpp +++ b/lib/AST/ASTDumper.cpp @@ -1040,9 +1040,10 @@ void ASTDumper::VisitOMPDeclareReductionDecl(const OMPDeclareReductionDecl *D) { NodeDumper.dumpName(D); NodeDumper.dumpType(D->getType()); OS << " combiner"; - dumpStmt(D->getCombiner()); - if (auto *Initializer = D->getInitializer()) { + NodeDumper.dumpPointer(D->getCombiner()); + if (const auto *Initializer = D->getInitializer()) { OS << " initializer"; + NodeDumper.dumpPointer(Initializer); switch (D->getInitializerKind()) { case OMPDeclareReductionDecl::DirectInit: OS << " omp_priv = "; @@ -1053,8 +1054,11 @@ void ASTDumper::VisitOMPDeclareReductionDecl(const OMPDeclareReductionDecl *D) { case OMPDeclareReductionDecl::CallInit: break; } - dumpStmt(Initializer); } + + dumpStmt(D->getCombiner()); + if (const auto *Initializer = D->getInitializer()) + dumpStmt(Initializer); } void ASTDumper::VisitOMPRequiresDecl(const OMPRequiresDecl *D) { diff --git a/test/AST/dump.cpp b/test/AST/dump.cpp index 6d7029d73d..b460e9325e 100644 --- a/test/AST/dump.cpp +++ b/test/AST/dump.cpp @@ -13,14 +13,14 @@ int ga, gb; #pragma omp declare reduction(fun : float : omp_out += omp_in) initializer(omp_priv = omp_orig + 15) -// CHECK: |-OMPDeclareReductionDecl {{.+}} col:35 operator+ 'int' combiner +// CHECK: |-OMPDeclareReductionDecl {{.+}} col:35 operator+ 'int' combiner 0x{{.+}} // CHECK-NEXT: | |-CompoundAssignOperator {{.+}} 'int' lvalue '*=' ComputeLHSTy='int' ComputeResultTy='int' // CHECK-NEXT: | | |-DeclRefExpr {{.+}} 'int' lvalue Var {{.+}} 'omp_out' 'int' // CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} 'int' // CHECK-NEXT: | | `-DeclRefExpr {{.+}} 'int' lvalue Var {{.+}} 'omp_in' 'int' // CHECK-NEXT: | |-VarDecl {{.+}} col:35 implicit used omp_in 'int' // CHECK-NEXT: | `-VarDecl {{.+}} col:35 implicit used omp_out 'int' -// CHECK-NEXT: |-OMPDeclareReductionDecl {{.+}} col:40 operator+ 'char' combiner +// CHECK-NEXT: |-OMPDeclareReductionDecl {{.+}} col:40 operator+ 'char' combiner 0x{{.+}} // CHECK-NEXT: | |-CompoundAssignOperator {{.+}} 'char' lvalue '*=' ComputeLHSTy='int' ComputeResultTy='int' // CHECK-NEXT: | | |-DeclRefExpr {{.+}} 'char' lvalue Var {{.+}} 'omp_out' 'char' // CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} 'int' @@ -28,7 +28,7 @@ int ga, gb; // CHECK-NEXT: | | `-DeclRefExpr {{.+}} 'char' lvalue Var {{.+}} 'omp_in' 'char' // CHECK-NEXT: | |-VarDecl {{.+}} col:40 implicit used omp_in 'char' // CHECK-NEXT: | `-VarDecl {{.+}} col:40 implicit used omp_out 'char' -// CHECK-NEXT: |-OMPDeclareReductionDecl {{.+}} col:37 fun 'float' combiner initializer +// CHECK-NEXT: |-OMPDeclareReductionDecl {{.+}} col:37 fun 'float' combiner 0x{{.+}} initializer 0x{{.+}} // CHECK-NEXT: | |-CompoundAssignOperator {{.+}} 'float' lvalue '+=' ComputeLHSTy='float' ComputeResultTy='float' // CHECK-NEXT: | | |-DeclRefExpr {{.+}} 'float' lvalue Var {{.+}} 'omp_out' 'float' // CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} 'float'