[flang-commits] [flang] [flang] Enumeration Type: (PR 4/5) Lowering (PR #193571)

via flang-commits flang-commits at lists.llvm.org
Sat Oct 10 19:49:16 PDT 2026


================
@@ -1184,43 +1184,61 @@ using VisitedSymbolSet = std::unordered_set<const Symbol *>;
 
 // Seeks out an allocatable or pointer ultimate component that is not
 // nested in a nonallocatable/nonpointer component with a specific defined I/O
-// procedure. The 'visited' set tracks derived types to break cycles caused by
-// an illegal recursive type definition (F2023 C749).
+// procedure.
+//
+// This is a two-color DFS to prevent missing unsafe components following a
+// shielded instantiation: 'onPath' holds the scopes on the recursion stack
+// (a repeat entry is a back edge from a recursive type and is pruned without
+// caching), and 'cache' memorizes each fully-walked subtree.
+using UnsafeComponentPathSet = std::unordered_set<const Scope *>;
+using UnsafeComponentCache = std::unordered_map<const Scope *, const Symbol *>;
----------------
MattPD wrote:

`check-io.cpp` is now absent from the patch.

https://github.com/llvm/llvm-project/pull/193571


More information about the flang-commits mailing list