[flang-commits] [flang] f0c5a4d - [flang] Fix shared library build

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Fri Jan 27 15:52:57 PST 2023


Author: Peter Klausler
Date: 2023-01-27T15:52:33-08:00
New Revision: f0c5a4d8546fd49f71c83b8aea0121bb2e639da5

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

LOG: [flang] Fix shared library build

A recent patch introduced a dependency upon Semantics from
Evaluate; fixing immediately.

Added: 
    

Modified: 
    flang/lib/Evaluate/type.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Evaluate/type.cpp b/flang/lib/Evaluate/type.cpp
index fa5775588075..8d49f629930a 100644
--- a/flang/lib/Evaluate/type.cpp
+++ b/flang/lib/Evaluate/type.cpp
@@ -215,7 +215,15 @@ static const semantics::Symbol *FindParentComponent(
   }
   if (scope) {
     const auto &dtDetails{typeSymbol.get<semantics::DerivedTypeDetails>()};
-    return dtDetails.GetParentComponent(*scope);
+    // TODO: Combine with semantics::DerivedTypeDetails::GetParentComponent
+    if (auto extends{dtDetails.GetParentComponentName()}) {
+      if (auto iter{scope->find(*extends)}; iter != scope->cend()) {
+        if (const semantics::Symbol & symbol{*iter->second};
+            symbol.test(semantics::Symbol::Flag::ParentComp)) {
+          return &symbol;
+        }
+      }
+    }
   }
   return nullptr;
 }


        


More information about the flang-commits mailing list