[flang-commits] [flang] 94278b3 - [flang] Move ResolveAccParts and ResolveOmpParts into better location… (#193497)
via flang-commits
flang-commits at lists.llvm.org
Wed Apr 22 06:46:13 PDT 2026
Author: Krzysztof Parzyszek
Date: 2026-04-22T08:46:08-05:00
New Revision: 94278b30b95777f8f688657022bfd634fe02c6bf
URL: https://github.com/llvm/llvm-project/commit/94278b30b95777f8f688657022bfd634fe02c6bf
DIFF: https://github.com/llvm/llvm-project/commit/94278b30b95777f8f688657022bfd634fe02c6bf.diff
LOG: [flang] Move ResolveAccParts and ResolveOmpParts into better location… (#193497)
…, NFC
These two functions, which are the entry points into the framework-
specific symbol resolution, somehow ended up in between OpenMP
functions. Move them to immediately after the visitor classes that they
rely on. Hopefully that will prevent them from drifting into obscure
places again.
Added:
Modified:
flang/lib/Semantics/resolve-directives.cpp
Removed:
################################################################################
diff --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp
index 9ba494a1b2821..5bd5b980eb3c5 100644
--- a/flang/lib/Semantics/resolve-directives.cpp
+++ b/flang/lib/Semantics/resolve-directives.cpp
@@ -1165,6 +1165,28 @@ class OmpAttributeVisitor : DirectiveAttributeVisitor<llvm::omp::Directive> {
}
};
+void ResolveAccParts(SemanticsContext &context, const parser::ProgramUnit &node,
+ Scope *topScope) {
+ if (context.IsEnabled(common::LanguageFeature::OpenACC)) {
+ AccAttributeVisitor{context, topScope}.Walk(node);
+ }
+}
+
+void ResolveOmpParts(
+ SemanticsContext &context, const parser::ProgramUnit &node) {
+ if (context.IsEnabled(common::LanguageFeature::OpenMP)) {
+ OmpAttributeVisitor{context}.Walk(node);
+ if (!context.AnyFatalError()) {
+ // The data-sharing attribute of the loop iteration variable for a
+ // sequential loop (2.15.1.1) can only be determined when visiting
+ // the corresponding DoConstruct, a second walk is to adjust the
+ // symbols for all the data-refs of that loop iteration variable
+ // prior to the DoConstruct.
+ OmpAttributeVisitor{context}.Walk(node);
+ }
+ }
+}
+
template <typename T>
bool DirectiveAttributeVisitor<T>::HasDataSharingAttributeObject(
const Symbol &object) {
@@ -3129,28 +3151,6 @@ void OmpAttributeVisitor::CheckMultipleAppearances(
}
}
-void ResolveAccParts(SemanticsContext &context, const parser::ProgramUnit &node,
- Scope *topScope) {
- if (context.IsEnabled(common::LanguageFeature::OpenACC)) {
- AccAttributeVisitor{context, topScope}.Walk(node);
- }
-}
-
-void ResolveOmpParts(
- SemanticsContext &context, const parser::ProgramUnit &node) {
- if (context.IsEnabled(common::LanguageFeature::OpenMP)) {
- OmpAttributeVisitor{context}.Walk(node);
- if (!context.AnyFatalError()) {
- // The data-sharing attribute of the loop iteration variable for a
- // sequential loop (2.15.1.1) can only be determined when visiting
- // the corresponding DoConstruct, a second walk is to adjust the
- // symbols for all the data-refs of that loop iteration variable
- // prior to the DoConstruct.
- OmpAttributeVisitor{context}.Walk(node);
- }
- }
-}
-
static bool IsSymbolThreadprivate(const Symbol &symbol) {
const Symbol &ultimate{symbol.GetUltimate()};
More information about the flang-commits
mailing list