OpenMPBlockConstruct, somewhat confusingly, represents most but not all block-associated constructs. It's derived from OmpBlockConstruct, as are all the remaining block-associated constructs. It does not correspond to any well-defined group of constructs. It's the collection of constructs that don't have their own types (and those that do have their own types do so for their own reasons). Using the broader OmpBlockConstruct in type-based visitors won't cause issues, because the specific overloads (for classes derived from it) will always be preferred.
25 lines
967 B
Fortran
25 lines
967 B
Fortran
! RUN: %flang_fc1 -fdebug-unparse -fopenmp -fopenmp-version=51 %s | FileCheck --ignore-case %s
|
|
! RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp -fopenmp-version=51 %s | FileCheck --check-prefix="PARSE-TREE" %s
|
|
|
|
program omp_scope
|
|
integer i
|
|
i = 10
|
|
|
|
!CHECK: !$OMP SCOPE PRIVATE(i)
|
|
!CHECK: !$OMP END SCOPE
|
|
|
|
!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OmpBlockConstruct
|
|
!PARSE-TREE: OmpBeginDirective
|
|
!PARSE-TREE: OmpDirectiveName -> llvm::omp::Directive = scope
|
|
!PARSE-TREE: OmpClauseList -> OmpClause -> Private -> OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'i'
|
|
!PARSE-TREE: Block
|
|
!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> PrintStmt
|
|
!PARSE-TREE: OmpEndDirective
|
|
!PARSE-TREE: OmpDirectiveName -> llvm::omp::Directive = scope
|
|
!PARSE-TREE: OmpClauseList -> OmpClause -> Nowait
|
|
|
|
!$omp scope private(i)
|
|
print *, "omp scope", i
|
|
!$omp end scope nowait
|
|
end program omp_scope
|