[flang-commits] [flang] d452429 - [flang] Fix shared library flang build (#108101)
via flang-commits
flang-commits at lists.llvm.org
Tue Sep 10 15:00:45 PDT 2024
Author: Peter Klausler
Date: 2024-09-10T15:00:42-07:00
New Revision: d452429821d3263a73b27387324bc272b47ed1bf
URL: https://github.com/llvm/llvm-project/commit/d452429821d3263a73b27387324bc272b47ed1bf
DIFF: https://github.com/llvm/llvm-project/commit/d452429821d3263a73b27387324bc272b47ed1bf.diff
LOG: [flang] Fix shared library flang build (#108101)
I broke the shared library builds a few minutes ago by introducing a
cyclic dependency between two parts of the compiler. Fix.
Added:
Modified:
flang/lib/Evaluate/check-expression.cpp
Removed:
################################################################################
diff --git a/flang/lib/Evaluate/check-expression.cpp b/flang/lib/Evaluate/check-expression.cpp
index 8a90404db0456c..a1ede7d7553bf6 100644
--- a/flang/lib/Evaluate/check-expression.cpp
+++ b/flang/lib/Evaluate/check-expression.cpp
@@ -525,6 +525,11 @@ class CheckSpecificationExprHelper
Result operator()(const semantics::Symbol &symbol) const {
const auto &ultimate{symbol.GetUltimate()};
+ const auto *object{ultimate.detailsIf<semantics::ObjectEntityDetails>()};
+ bool isInitialized{semantics::IsSaved(ultimate) &&
+ !IsAllocatable(ultimate) && object &&
+ (ultimate.test(Symbol::Flag::InDataStmt) ||
+ object->init().has_value())};
if (const auto *assoc{
ultimate.detailsIf<semantics::AssocEntityDetails>()}) {
return (*this)(assoc->expr());
@@ -554,8 +559,7 @@ class CheckSpecificationExprHelper
}
} else if (&symbol.owner() != &scope_ || &ultimate.owner() != &scope_) {
return std::nullopt; // host association is in play
- } else if (semantics::IsSaved(ultimate) &&
- semantics::IsInitialized(ultimate) &&
+ } else if (isInitialized &&
context_.languageFeatures().IsEnabled(
common::LanguageFeature::SavedLocalInSpecExpr)) {
if (!scope_.IsModuleFile() &&
More information about the flang-commits
mailing list