[flang-commits] [flang] [flang][OpenMP] Use parser::UnwrapRef instead of thing/value, NFC (PR #164087)
Krzysztof Parzyszek via flang-commits
flang-commits at lists.llvm.org
Sat Oct 18 06:55:01 PDT 2025
https://github.com/kparzysz created https://github.com/llvm/llvm-project/pull/164087
None
>From 0a56d09b76ba7d100baffbefedd3439eaa886b80 Mon Sep 17 00:00:00 2001
From: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
Date: Fri, 17 Oct 2025 17:54:56 -0500
Subject: [PATCH] [flang][OpenMP] Use parser::UnwrapRef instead of thing/value,
NFC
---
flang/lib/Semantics/check-omp-atomic.cpp | 2 +-
flang/lib/Semantics/resolve-directives.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/flang/lib/Semantics/check-omp-atomic.cpp b/flang/lib/Semantics/check-omp-atomic.cpp
index 515121af04d56..2707921ca1dfa 100644
--- a/flang/lib/Semantics/check-omp-atomic.cpp
+++ b/flang/lib/Semantics/check-omp-atomic.cpp
@@ -286,7 +286,7 @@ static std::optional<AnalyzedCondStmt> AnalyzeConditionalStmt(
// Extract the evaluate::Expr from ScalarLogicalExpr.
auto getFromLogical{[](const parser::ScalarLogicalExpr &logical) {
// ScalarLogicalExpr is Scalar<Logical<common::Indirection<Expr>>>
- const parser::Expr &expr{logical.thing.thing.value()};
+ auto &expr{parser::UnwrapRef<parser::Expr>(logical)};
return GetEvaluateExpr(expr);
}};
diff --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp
index 7067ed3d99286..8fe5fd83ee6d8 100644
--- a/flang/lib/Semantics/resolve-directives.cpp
+++ b/flang/lib/Semantics/resolve-directives.cpp
@@ -560,7 +560,7 @@ class OmpAttributeVisitor : DirectiveAttributeVisitor<llvm::omp::Directive> {
auto getArgument{[&](auto &&maybeClause) {
if (maybeClause) {
// Scalar<Logical<Constant<common::Indirection<Expr>>>>
- auto &parserExpr{maybeClause->v.thing.thing.thing.value()};
+ auto &parserExpr{parser::UnwrapRef<parser::Expr>(*maybeClause)};
evaluate::ExpressionAnalyzer ea{context_};
if (auto &&maybeExpr{ea.Analyze(parserExpr)}) {
if (auto v{omp::GetLogicalValue(*maybeExpr)}) {
More information about the flang-commits
mailing list