diff options
author | Joel E. Denny <jdenny.ornl@gmail.com> | 2019-05-28 19:27:19 +0000 |
---|---|---|
committer | Joel E. Denny <jdenny.ornl@gmail.com> | 2019-05-28 19:27:19 +0000 |
commit | 91f8066d1de5df00e29ac1c517d2e7353dcb3a60 (patch) | |
tree | 01d179caa8c82e9c3ad9e27443f78af7cda69bcf /clang/test/AST/ast-dump-openmp-ordered.c | |
parent | 363079fe73eb6f179ecdde81e6f0d526d4ba1cf8 (diff) | |
download | bcm5719-llvm-91f8066d1de5df00e29ac1c517d2e7353dcb3a60.tar.gz bcm5719-llvm-91f8066d1de5df00e29ac1c517d2e7353dcb3a60.zip |
[OpenMP] Set pragma start loc to `#pragma` loc
This patch adjusts `PragmaOpenMPHandler` to set the location of
`tok::annot_pragma_openmp` to the `#pragma` location instead of the
`omp` location so that the former becomes the start location of the
OpenMP AST node. This can be useful when, for example, rewriting a
directive using Clang's Rewrite facility. Most of this patch updates
tests for changes to locations in diagnostics and `-ast-dump` output.
Reviewed By: ABataev, lebedev.ri, Meinersbur, aaron.ballman
Differential Revision: https://reviews.llvm.org/D61509
llvm-svn: 361867
Diffstat (limited to 'clang/test/AST/ast-dump-openmp-ordered.c')
-rw-r--r-- | clang/test/AST/ast-dump-openmp-ordered.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/test/AST/ast-dump-openmp-ordered.c b/clang/test/AST/ast-dump-openmp-ordered.c index 0cce4525d6c..9f39be3e6d8 100644 --- a/clang/test/AST/ast-dump-openmp-ordered.c +++ b/clang/test/AST/ast-dump-openmp-ordered.c @@ -21,15 +21,15 @@ void test_three(int x) { // CHECK: TranslationUnitDecl {{.*}} <<invalid sloc>> <invalid sloc> // CHECK: |-FunctionDecl {{.*}} <{{.*}}ast-dump-openmp-ordered.c:3:1, line:6:1> line:3:6 test_one 'void ()' // CHECK-NEXT: | `-CompoundStmt {{.*}} <col:17, line:6:1> -// CHECK-NEXT: | `-OMPOrderedDirective {{.*}} <line:4:9, col:20> +// CHECK-NEXT: | `-OMPOrderedDirective {{.*}} <line:4:1, col:20> // CHECK-NEXT: | `-CapturedStmt {{.*}} <line:5:3> // CHECK-NEXT: | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> // CHECK-NEXT: | |-NullStmt {{.*}} <col:3> openmp_structured_block -// CHECK-NEXT: | `-ImplicitParamDecl {{.*}} <line:4:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-ordered.c:4:9) *const restrict' +// CHECK-NEXT: | `-ImplicitParamDecl {{.*}} <line:4:1> col:1 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-ordered.c:4:1) *const restrict' // CHECK-NEXT: |-FunctionDecl {{.*}} <line:8:1, line:12:1> line:8:6 test_two 'void (int)' // CHECK-NEXT: | |-ParmVarDecl {{.*}} <col:15, col:19> col:19 used x 'int' // CHECK-NEXT: | `-CompoundStmt {{.*}} <col:22, line:12:1> -// CHECK-NEXT: | `-OMPForDirective {{.*}} <line:9:9, col:24> +// CHECK-NEXT: | `-OMPForDirective {{.*}} <line:9:1, col:24> // CHECK-NEXT: | |-OMPOrderedClause {{.*}} <col:17, col:24> // CHECK-NEXT: | | `-<<<NULL>>> // CHECK-NEXT: | `-CapturedStmt {{.*}} <line:10:3, line:11:5> @@ -47,14 +47,14 @@ void test_three(int x) { // CHECK-NEXT: | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | | `-NullStmt {{.*}} <line:11:5> openmp_structured_block -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <line:9:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-ordered.c:9:9) *const restrict' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <line:9:1> col:1 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-ordered.c:9:1) *const restrict' // CHECK-NEXT: | | `-VarDecl {{.*}} <line:10:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: | `-DeclRefExpr {{.*}} <col:3> 'int' lvalue ParmVar {{.*}} 'x' 'int' // CHECK-NEXT: `-FunctionDecl {{.*}} <line:14:1, line:19:1> line:14:6 test_three 'void (int)' // CHECK-NEXT: |-ParmVarDecl {{.*}} <col:17, col:21> col:21 used x 'int' // CHECK-NEXT: `-CompoundStmt {{.*}} <col:24, line:19:1> -// CHECK-NEXT: `-OMPForDirective {{.*}} <line:15:9, col:27> +// CHECK-NEXT: `-OMPForDirective {{.*}} <line:15:1, col:27> // CHECK-NEXT: |-OMPOrderedClause {{.*}} <col:17, col:26> // CHECK-NEXT: | `-ConstantExpr {{.*}} <col:25> 'int' // CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:25> 'int' 1 @@ -73,10 +73,10 @@ void test_three(int x) { // CHECK-NEXT: | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++' // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int' // CHECK-NEXT: | | `-CompoundStmt {{.*}} <col:31, line:18:3> openmp_structured_block -// CHECK-NEXT: | | `-OMPOrderedDirective {{.*}} <line:17:9, col:35> openmp_standalone_directive +// CHECK-NEXT: | | `-OMPOrderedDirective {{.*}} <line:17:1, col:35> openmp_standalone_directive // CHECK-NEXT: | | |-OMPDependClause {{.*}} <col:21, <invalid sloc>> // CHECK-NEXT: | | `-<<<NULL>>> -// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} <line:15:9> col:9 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-ordered.c:15:9) *const restrict' +// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} <line:15:1> col:1 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-ordered.c:15:1) *const restrict' // CHECK-NEXT: | `-VarDecl {{.*}} <line:16:8, col:16> col:12 used i 'int' cinit // CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:16> 'int' 0 // CHECK-NEXT: `-DeclRefExpr {{.*}} <col:3> 'int' lvalue ParmVar {{.*}} 'x' 'int' |