[flang-commits] [flang] [llvm] [flang][OpenMP] Parse lastprivate modifier, add TODO to lowering (PR #110568)
via flang-commits
flang-commits at lists.llvm.org
Mon Sep 30 13:45:13 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 93af9d6cb4fdffdd80f924b5ab9dd4770c5376b8 14440f1ca5ea7214cc4e084b96258478cead8f66 --extensions h,cpp -- flang/include/flang/Parser/dump-parse-tree.h flang/include/flang/Parser/parse-tree.h flang/lib/Lower/OpenMP/Clauses.cpp flang/lib/Lower/OpenMP/DataSharingProcessor.cpp flang/lib/Lower/OpenMP/OpenMP.cpp flang/lib/Lower/OpenMP/Utils.cpp flang/lib/Lower/OpenMP/Utils.h flang/lib/Parser/openmp-parsers.cpp flang/lib/Semantics/check-omp-structure.cpp flang/lib/Semantics/resolve-directives.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp
index d40ccbf140..cc2930cbd7 100644
--- a/flang/lib/Parser/openmp-parsers.cpp
+++ b/flang/lib/Parser/openmp-parsers.cpp
@@ -235,7 +235,7 @@ TYPE_PARSER(
// OMP 5.0 2.19.4.5 LASTPRIVATE ([lastprivate-modifier :] list)
TYPE_PARSER(construct<OmpLastprivateClause>(
maybe("CONDITIONAL" >>
- pure(OmpLastprivateClause::LastprivateModifier::Conditional) / ":"),
+ pure(OmpLastprivateClause::LastprivateModifier::Conditional) / ":"),
Parser<OmpObjectList>{}))
TYPE_PARSER(
diff --git a/flang/lib/Semantics/check-omp-structure.cpp b/flang/lib/Semantics/check-omp-structure.cpp
index d8f939d4cf..1797db7fda 100644
--- a/flang/lib/Semantics/check-omp-structure.cpp
+++ b/flang/lib/Semantics/check-omp-structure.cpp
@@ -3205,9 +3205,9 @@ void OmpStructureChecker::Enter(const parser::OmpClause::Lastprivate &x) {
std::string thisVersion{
std::to_string(version / 10) + "." + std::to_string(version % 10)};
context_.Say(GetContext().clauseSource,
- "LASTPRIVATE clause with CONDITIONAL modifier is not "
- "allowed in OpenMP v%s, try -fopenmp-version=%d"_err_en_US,
- thisVersion, allowedInVersion);
+ "LASTPRIVATE clause with CONDITIONAL modifier is not "
+ "allowed in OpenMP v%s, try -fopenmp-version=%d"_err_en_US,
+ thisVersion, allowedInVersion);
}
}
}
@@ -3634,19 +3634,17 @@ const parser::OmpObjectList *OmpStructureChecker::GetOmpObjectList(
const parser::OmpClause &clause) {
// Clauses with OmpObjectList as its data member
- using MemberObjectListClauses =
- std::tuple<parser::OmpClause::Copyprivate, parser::OmpClause::Copyin,
- parser::OmpClause::Firstprivate, parser::OmpClause::From,
- parser::OmpClause::Link, parser::OmpClause::Private,
- parser::OmpClause::Shared, parser::OmpClause::To,
- parser::OmpClause::Enter, parser::OmpClause::UseDevicePtr,
- parser::OmpClause::UseDeviceAddr>;
+ using MemberObjectListClauses = std::tuple<parser::OmpClause::Copyprivate,
+ parser::OmpClause::Copyin, parser::OmpClause::Firstprivate,
+ parser::OmpClause::From, parser::OmpClause::Link,
+ parser::OmpClause::Private, parser::OmpClause::Shared,
+ parser::OmpClause::To, parser::OmpClause::Enter,
+ parser::OmpClause::UseDevicePtr, parser::OmpClause::UseDeviceAddr>;
// Clauses with OmpObjectList in the tuple
- using TupleObjectListClauses =
- std::tuple<parser::OmpClause::Allocate, parser::OmpClause::Lastprivate,
- parser::OmpClause::Map, parser::OmpClause::Reduction,
- parser::OmpClause::Aligned>;
+ using TupleObjectListClauses = std::tuple<parser::OmpClause::Allocate,
+ parser::OmpClause::Lastprivate, parser::OmpClause::Map,
+ parser::OmpClause::Reduction, parser::OmpClause::Aligned>;
// TODO:: Generate the tuples using TableGen.
// Handle other constructs with OmpObjectList such as OpenMPThreadprivate.
``````````
</details>
https://github.com/llvm/llvm-project/pull/110568
More information about the flang-commits
mailing list