Skip to content

Commit 3dcc52d

Browse files
committed
[flang][OpenMP] Add comments to IsContiguous, improve formatting, NFC
1 parent 2757dc3 commit 3dcc52d

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

flang/lib/Semantics/check-omp-structure.cpp

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -302,22 +302,26 @@ struct ContiguousHelper {
302302
};
303303
} // namespace
304304

305+
// Return values:
306+
// - std::optional<bool>{true} if the object is known to be contiguous
307+
// - std::optional<bool>{false} if the object is known not to be contiguous
308+
// - std::nullopt if the object contiguity cannot be determined
305309
std::optional<bool> OmpStructureChecker::IsContiguous(
306310
const parser::OmpObject &object) {
307-
return common::visit(common::visitors{
308-
[&](const parser::Name &x) {
309-
// Any member of a common block must be contiguous.
310-
return std::optional<bool>{true};
311-
},
312-
[&](const parser::Designator &x) {
313-
evaluate::ExpressionAnalyzer ea{context_};
314-
if (MaybeExpr maybeExpr{ea.Analyze(x)}) {
315-
return ContiguousHelper{context_}.Visit(
316-
*maybeExpr);
317-
}
318-
return std::optional<bool>{};
319-
},
320-
},
311+
return common::visit( //
312+
common::visitors{
313+
[&](const parser::Name &x) {
314+
// Any member of a common block must be contiguous.
315+
return std::optional<bool>{true};
316+
},
317+
[&](const parser::Designator &x) {
318+
evaluate::ExpressionAnalyzer ea{context_};
319+
if (MaybeExpr maybeExpr{ea.Analyze(x)}) {
320+
return ContiguousHelper{context_}.Visit(*maybeExpr);
321+
}
322+
return std::optional<bool>{};
323+
},
324+
},
321325
object.u);
322326
}
323327

0 commit comments

Comments
 (0)