[PATCH] D93641: [Flang][openmp][2/5] Make Default clause part of OmpClause
sameeran joshi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 21 23:48:09 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf72c384b5ba9: [Flang][openmp][2/5] Make Default clause part of OmpClause (authored by sameeranjoshi).
Changed prior to commit:
https://reviews.llvm.org/D93641?vs=313124&id=313250#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93641/new/
https://reviews.llvm.org/D93641
Files:
flang/lib/Lower/OpenMP.cpp
flang/lib/Parser/openmp-parsers.cpp
flang/lib/Parser/unparse.cpp
flang/lib/Semantics/check-omp-structure.cpp
flang/lib/Semantics/check-omp-structure.h
llvm/include/llvm/Frontend/OpenMP/OMP.td
Index: llvm/include/llvm/Frontend/OpenMP/OMP.td
===================================================================
--- llvm/include/llvm/Frontend/OpenMP/OMP.td
+++ llvm/include/llvm/Frontend/OpenMP/OMP.td
@@ -62,7 +62,7 @@
}
def OMPC_Default : Clause<"default"> {
let clangClass = "OMPDefaultClause";
- let flangClass = "OmpDefaultClause";
+ let flangClassValue = "OmpDefaultClause";
}
def OMPC_Private : Clause<"private"> {
let clangClass = "OMPPrivateClause";
Index: flang/lib/Semantics/check-omp-structure.h
===================================================================
--- flang/lib/Semantics/check-omp-structure.h
+++ flang/lib/Semantics/check-omp-structure.h
@@ -137,6 +137,7 @@
void Enter(const parser::OmpClause::Collapse &);
void Enter(const parser::OmpClause::Copyin &);
void Enter(const parser::OmpClause::Copyprivate &);
+ void Enter(const parser::OmpClause::Default &);
void Enter(const parser::OmpClause::Device &);
void Enter(const parser::OmpClause::Final &);
void Enter(const parser::OmpClause::Firstprivate &);
@@ -175,7 +176,6 @@
void Enter(const parser::OmpAtomicCapture &);
void Leave(const parser::OmpAtomic &);
void Enter(const parser::OmpAlignedClause &);
- void Enter(const parser::OmpDefaultClause &);
void Enter(const parser::OmpDefaultmapClause &);
void Enter(const parser::OmpDependClause &);
void Enter(const parser::OmpDistScheduleClause &);
Index: flang/lib/Semantics/check-omp-structure.cpp
===================================================================
--- flang/lib/Semantics/check-omp-structure.cpp
+++ flang/lib/Semantics/check-omp-structure.cpp
@@ -406,6 +406,7 @@
CHECK_SIMPLE_CLAUSE(Allocate, OMPC_allocate)
CHECK_SIMPLE_CLAUSE(Copyin, OMPC_copyin)
CHECK_SIMPLE_CLAUSE(Copyprivate, OMPC_copyprivate)
+CHECK_SIMPLE_CLAUSE(Default, OMPC_default)
CHECK_SIMPLE_CLAUSE(Device, OMPC_device)
CHECK_SIMPLE_CLAUSE(Final, OMPC_final)
CHECK_SIMPLE_CLAUSE(Firstprivate, OMPC_firstprivate)
@@ -490,7 +491,6 @@
}
}
// Following clauses have a seperate node in parse-tree.h.
-CHECK_SIMPLE_PARSER_CLAUSE(OmpDefaultClause, OMPC_default)
CHECK_SIMPLE_PARSER_CLAUSE(OmpDistScheduleClause, OMPC_dist_schedule)
CHECK_SIMPLE_PARSER_CLAUSE(OmpNowait, OMPC_nowait)
CHECK_SIMPLE_PARSER_CLAUSE(OmpProcBindClause, OMPC_proc_bind)
Index: flang/lib/Parser/unparse.cpp
===================================================================
--- flang/lib/Parser/unparse.cpp
+++ flang/lib/Parser/unparse.cpp
@@ -2058,11 +2058,6 @@
},
x.u);
}
- bool Pre(const OmpDefaultClause &) {
- Word("DEFAULT(");
- return true;
- }
- void Post(const OmpDefaultClause &) { Put(")"); }
bool Pre(const OmpProcBindClause &) {
Word("PROC_BIND(");
return true;
Index: flang/lib/Parser/openmp-parsers.cpp
===================================================================
--- flang/lib/Parser/openmp-parsers.cpp
+++ flang/lib/Parser/openmp-parsers.cpp
@@ -167,8 +167,8 @@
parenthesized(Parser<OmpObjectList>{}))) ||
"COPYPRIVATE" >> construct<OmpClause>(construct<OmpClause::Copyprivate>(
(parenthesized(Parser<OmpObjectList>{})))) ||
- "DEFAULT"_id >>
- construct<OmpClause>(parenthesized(Parser<OmpDefaultClause>{})) ||
+ "DEFAULT"_id >> construct<OmpClause>(construct<OmpClause::Default>(
+ parenthesized(Parser<OmpDefaultClause>{}))) ||
"DEFAULTMAP" >>
construct<OmpClause>(parenthesized(Parser<OmpDefaultmapClause>{})) ||
"DEPEND" >>
Index: flang/lib/Lower/OpenMP.cpp
===================================================================
--- flang/lib/Lower/OpenMP.cpp
+++ flang/lib/Lower/OpenMP.cpp
@@ -191,8 +191,9 @@
// Handle attribute based clauses.
for (const auto &clause : parallelOpClauseList.v) {
if (const auto &defaultClause =
- std::get_if<Fortran::parser::OmpDefaultClause>(&clause.u)) {
- switch (defaultClause->v) {
+ std::get_if<Fortran::parser::OmpClause::Default>(&clause.u)) {
+ const auto &ompDefaultClause{defaultClause->v};
+ switch (ompDefaultClause.v) {
case Fortran::parser::OmpDefaultClause::Type::Private:
parallelOp.default_valAttr(firOpBuilder.getStringAttr(
omp::stringifyClauseDefault(omp::ClauseDefault::defprivate)));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93641.313250.patch
Type: text/x-patch
Size: 4381 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201222/8962ac0f/attachment.bin>
More information about the llvm-commits
mailing list