[flang-commits] [flang] 42bfd05 - [flang] Move IsCoarray() to fix shared library build

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Mon Nov 22 12:46:23 PST 2021


Author: Peter Klausler
Date: 2021-11-22T12:46:15-08:00
New Revision: 42bfd059bf80c9b61b263747bfa31d97ac38b0c7

URL: https://github.com/llvm/llvm-project/commit/42bfd059bf80c9b61b263747bfa31d97ac38b0c7
DIFF: https://github.com/llvm/llvm-project/commit/42bfd059bf80c9b61b263747bfa31d97ac38b0c7.diff

LOG: [flang] Move IsCoarray() to fix shared library build

The predicate IsCoarray() needs to be in libFortranEvaluate so that
IsSaved() can call it without breaking the shared library build.

Pushed without pre-commit review as I'm moving code around and
the fix to the shared build is confirmed.

Added: 
    

Modified: 
    flang/include/flang/Evaluate/tools.h
    flang/include/flang/Semantics/tools.h
    flang/lib/Evaluate/tools.cpp
    flang/lib/Semantics/tools.cpp

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Evaluate/tools.h b/flang/include/flang/Evaluate/tools.h
index df56a3b0cb040..5fcc74594b60b 100644
--- a/flang/include/flang/Evaluate/tools.h
+++ b/flang/include/flang/Evaluate/tools.h
@@ -1051,6 +1051,7 @@ bool IsProcedure(const Symbol &);
 bool IsProcedure(const Scope &);
 bool IsProcedurePointer(const Symbol &);
 bool IsAutomatic(const Symbol &);
+bool IsCoarray(const Symbol &);
 bool IsSaved(const Symbol &); // saved implicitly or explicitly
 bool IsDummy(const Symbol &);
 bool IsFunctionResult(const Symbol &);

diff  --git a/flang/include/flang/Semantics/tools.h b/flang/include/flang/Semantics/tools.h
index 6ab3e5e245884..6047eeae9dfc4 100644
--- a/flang/include/flang/Semantics/tools.h
+++ b/flang/include/flang/Semantics/tools.h
@@ -164,7 +164,6 @@ bool IsFinalizable(
 bool IsFinalizable(
     const DerivedTypeSpec &, std::set<const DerivedTypeSpec *> * = nullptr);
 bool HasImpureFinal(const DerivedTypeSpec &);
-bool IsCoarray(const Symbol &);
 bool IsInBlankCommon(const Symbol &);
 inline bool IsAssumedSizeArray(const Symbol &symbol) {
   const auto *details{symbol.detailsIf<ObjectEntityDetails>()};

diff  --git a/flang/lib/Evaluate/tools.cpp b/flang/lib/Evaluate/tools.cpp
index 86600ca962796..bbfb46e53119e 100644
--- a/flang/lib/Evaluate/tools.cpp
+++ b/flang/lib/Evaluate/tools.cpp
@@ -1193,6 +1193,10 @@ bool IsAutomatic(const Symbol &original) {
   return false;
 }
 
+bool IsCoarray(const Symbol &symbol) {
+  return GetAssociationRoot(symbol).Corank() > 0;
+}
+
 bool IsSaved(const Symbol &original) {
   const Symbol &symbol{GetAssociationRoot(original)};
   const Scope &scope{symbol.owner()};

diff  --git a/flang/lib/Semantics/tools.cpp b/flang/lib/Semantics/tools.cpp
index f3df880fffca1..0be899c9fedea 100644
--- a/flang/lib/Semantics/tools.cpp
+++ b/flang/lib/Semantics/tools.cpp
@@ -676,8 +676,6 @@ bool HasImpureFinal(const DerivedTypeSpec &derived) {
   }
 }
 
-bool IsCoarray(const Symbol &symbol) { return symbol.Corank() > 0; }
-
 bool IsAssumedLengthCharacter(const Symbol &symbol) {
   if (const DeclTypeSpec * type{symbol.GetType()}) {
     return type->category() == DeclTypeSpec::Character &&


        


More information about the flang-commits mailing list