construct<OmpClause>(construct<OmpClause::DynamicAllocators>()) ||
"FINAL" >> construct<OmpClause>(construct<OmpClause::Final>(
parenthesized(scalarLogicalExpr))) ||
+ "FULL" >> construct<OmpClause>(construct<OmpClause::Full>()) ||
"FIRSTPRIVATE" >> construct<OmpClause>(construct<OmpClause::Firstprivate>(
parenthesized(Parser<OmpObjectList>{}))) ||
"FROM" >> construct<OmpClause>(construct<OmpClause::From>(
parenthesized(scalarIntExpr))) ||
"ORDERED" >> construct<OmpClause>(construct<OmpClause::Ordered>(
maybe(parenthesized(scalarIntConstantExpr)))) ||
+ "PARTIAL" >> construct<OmpClause>(construct<OmpClause::Partial>(
+ maybe(parenthesized(scalarIntConstantExpr)))) ||
"PRIORITY" >> construct<OmpClause>(construct<OmpClause::Priority>(
parenthesized(scalarIntExpr))) ||
"PRIVATE" >> construct<OmpClause>(construct<OmpClause::Private>(
"TEAMS DISTRIBUTE SIMD" >>
pure(llvm::omp::Directive::OMPD_teams_distribute_simd),
"TEAMS DISTRIBUTE" >> pure(llvm::omp::Directive::OMPD_teams_distribute),
- "TILE" >> pure(llvm::omp::Directive::OMPD_tile)))))
+ "TILE" >> pure(llvm::omp::Directive::OMPD_tile),
+ "UNROLL" >> pure(llvm::omp::Directive::OMPD_unroll)))))
TYPE_PARSER(sourced(construct<OmpBeginLoopDirective>(
sourced(Parser<OmpLoopDirective>{}), Parser<OmpClauseList>{})))
case llvm::omp::Directive::OMPD_tile:
Word("TILE ");
break;
+ case llvm::omp::Directive::OMPD_unroll:
+ Word("UNROLL ");
+ break;
default:
break;
}
case llvm::omp::Directive::OMPD_teams_distribute_parallel_do_simd:
case llvm::omp::Directive::OMPD_teams_distribute_simd:
case llvm::omp::Directive::OMPD_tile:
+ case llvm::omp::Directive::OMPD_unroll:
PushContext(beginDir.source, beginDir.v);
break;
default:
--- /dev/null
+! RUN: %flang_fc1 -fdebug-unparse -fopenmp %s | FileCheck --ignore-case %s
+! RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp %s | FileCheck --check-prefix="PARSE-TREE" %s
+
+subroutine openmp_parse_unroll(x)
+
+ integer, intent(inout)::x
+
+!CHECK: !$omp unroll full
+!$omp unroll full
+!CHECK: do
+ do x = 1, 100
+ call F1()
+!CHECK: end do
+ end do
+!CHECK: !$omp end unroll
+!$omp end unroll
+
+!PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
+!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpLoopDirective -> llvm::omp::Directive = unroll
+!PARSE-TREE: OmpClauseList -> OmpClause -> Full
+END subroutine openmp_parse_unroll
--- /dev/null
+! RUN: %flang_fc1 -fdebug-unparse-no-sema -fopenmp %s | FileCheck --ignore-case %s
+! RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp %s | FileCheck --check-prefix="PARSE-TREE" %s
+
+subroutine openmp_parse_unroll(x)
+
+ integer, intent(inout)::x
+
+!CHECK: !$omp unroll partial(3)
+!$omp unroll partial(3)
+!CHECK: do
+ do x = 1, 100
+ call F1()
+!CHECK: end do
+ end do
+!CHECK: !$omp end unroll
+!$omp end unroll
+
+!PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
+!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpLoopDirective -> llvm::omp::Directive = unroll
+!PARSE-TREE: OmpClauseList -> OmpClause -> Partial -> Scalar -> Integer -> Constant -> Expr = '3_4'
+!PARSE-TREE: LiteralConstant -> IntLiteralConstant = '3'
+
+END subroutine openmp_parse_unroll
let flangClass = "ScalarIntExpr";
let isValueList = true;
}
-def OMPC_Full: Clause<"full"> { let clangClass = "OMPFullClause"; }
-def OMPC_Partial: Clause<"partial"> { let clangClass = "OMPPartialClause"; }
+def OMPC_Full: Clause<"full"> {
+ let clangClass = "OMPFullClause";
+}
+def OMPC_Partial: Clause<"partial"> {
+ let clangClass = "OMPPartialClause";
+ let flangClass = "ScalarIntConstantExpr";
+ let isValueOptional = true;
+ }
def OMPC_FirstPrivate : Clause<"firstprivate"> {
let clangClass = "OMPFirstprivateClause";
let flangClass = "OmpObjectList";