Skip to content

Commit 4e3c975

Browse files
committed
clang-format
1 parent 424475c commit 4e3c975

File tree

2 files changed

+27
-29
lines changed

2 files changed

+27
-29
lines changed

flang/include/flang/Parser/parse-tree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3458,7 +3458,7 @@ struct OmpMapClause {
34583458
ENUM_CLASS(Type, To, From, Tofrom, Alloc, Release, Delete)
34593459
TUPLE_CLASS_BOILERPLATE(OmpMapClause);
34603460
std::tuple<std::optional<std::list<TypeModifier>>, std::optional<Type>,
3461-
OmpObjectList>
3461+
OmpObjectList>
34623462
t;
34633463
};
34643464

flang/lib/Parser/openmp-parsers.cpp

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,16 @@ namespace Fortran::parser {
2323
constexpr auto startOmpLine = skipStuffBeforeStatement >> "!$OMP "_sptok;
2424
constexpr auto endOmpLine = space >> endOfLine;
2525

26-
template <typename Separator>
27-
struct MapModifiers {
28-
constexpr MapModifiers(Separator sep,
29-
std::optional<MessageFixedText> msg = std::nullopt)
26+
template <typename Separator> struct MapModifiers {
27+
constexpr MapModifiers(
28+
Separator sep, std::optional<MessageFixedText> msg = std::nullopt)
3029
: sep_(sep), msg_(msg) {}
3130
constexpr MapModifiers(const MapModifiers &) = default;
3231
constexpr MapModifiers(MapModifiers &&) = default;
3332

3433
using resultType =
3534
std::tuple<std::optional<std::list<OmpMapClause::TypeModifier>>,
36-
std::optional<OmpMapClause::Type>>;
35+
std::optional<OmpMapClause::Type>>;
3736

3837
std::optional<resultType> Parse(ParseState &state) const {
3938
auto pmod{Parser<OmpMapClause::TypeModifier>{}};
@@ -47,8 +46,8 @@ struct MapModifiers {
4746
*maybe(attempt(nonemptySeparated(pmod, sep_))).Parse(state)}) {
4847
// mods = optional<list>, and the list is nonempty.
4948
return attempt(sep_).Parse(state)
50-
? resultType(mods, *maybe(attempt(ptype)).Parse(state))
51-
: resultType(mods, std::nullopt);
49+
? resultType(mods, *maybe(attempt(ptype)).Parse(state))
50+
: resultType(mods, std::nullopt);
5251
}
5352
return {std::nullopt, *maybe(attempt(ptype)).Parse(state)};
5453
}();
@@ -92,35 +91,34 @@ TYPE_PARSER(construct<OmpProcBindClause>(
9291
// map-type-modifiers -> map-type-modifier [,] [...]
9392
// map-type-modifier -> ALWAYS | CLOSE | OMPX_HOLD | PRESENT
9493
// map-type -> ALLOC | DELETE | FROM | RELEASE | TO | TOFROM
95-
TYPE_PARSER(construct<OmpMapClause::TypeModifier>(
94+
TYPE_PARSER(
95+
construct<OmpMapClause::TypeModifier>(
9696
"ALWAYS" >> pure(OmpMapClause::TypeModifier::Always) ||
9797
"CLOSE" >> pure(OmpMapClause::TypeModifier::Close) ||
9898
"OMPX_HOLD" >> pure(OmpMapClause::TypeModifier::OmpxHold) ||
9999
"PRESENT" >> pure(OmpMapClause::TypeModifier::Present)))
100100

101-
TYPE_PARSER(construct<OmpMapClause::Type>(
102-
"ALLOC" >> pure(OmpMapClause::Type::Alloc) ||
103-
"DELETE" >> pure(OmpMapClause::Type::Delete) ||
104-
"FROM" >> pure(OmpMapClause::Type::From) ||
105-
"RELEASE" >> pure(OmpMapClause::Type::Release) ||
106-
"TO"_id >> pure(OmpMapClause::Type::To) ||
107-
"TOFROM" >> pure(OmpMapClause::Type::Tofrom)))
108-
109-
static inline OmpMapClause
110-
makeMapClause(std::tuple<std::optional<std::list<OmpMapClause::TypeModifier>>,
111-
std::optional<OmpMapClause::Type>> &&mod,
112-
OmpObjectList &&obj) {
113-
return OmpMapClause{std::move(std::get<0>(mod)), std::move(std::get<1>(mod)),
114-
std::move(obj)};
101+
TYPE_PARSER(
102+
construct<OmpMapClause::Type>("ALLOC" >> pure(OmpMapClause::Type::Alloc) ||
103+
"DELETE" >> pure(OmpMapClause::Type::Delete) ||
104+
"FROM" >> pure(OmpMapClause::Type::From) ||
105+
"RELEASE" >> pure(OmpMapClause::Type::Release) ||
106+
"TO"_id >> pure(OmpMapClause::Type::To) ||
107+
"TOFROM" >> pure(OmpMapClause::Type::Tofrom)))
108+
109+
static inline OmpMapClause makeMapClause(
110+
std::tuple<std::optional<std::list<OmpMapClause::TypeModifier>>,
111+
std::optional<OmpMapClause::Type>> &&mod,
112+
OmpObjectList &&obj) {
113+
return OmpMapClause{
114+
std::move(std::get<0>(mod)), std::move(std::get<1>(mod)), std::move(obj)};
115115
}
116116

117-
TYPE_PARSER(construct<OmpMapClause>(applyFunction(
118-
makeMapClause,
117+
TYPE_PARSER(construct<OmpMapClause>(applyFunction(makeMapClause,
119118
(MapModifiers(","_tok) ||
120-
MapModifiers(
121-
maybe(","_tok),
122-
"the specification of modifiers without comma separators for the "
123-
"'MAP' clause has been deprecated"_port_en_US)),
119+
MapModifiers(maybe(","_tok),
120+
"the specification of modifiers without comma separators for the "
121+
"'MAP' clause has been deprecated"_port_en_US)),
124122
Parser<OmpObjectList>{})))
125123

126124
// [OpenMP 5.0]

0 commit comments

Comments
 (0)