[flang-commits] [flang] [flang][hlfir] Make the parent type the first component (PR #69348)

Valentin Clement バレンタイン クレメン via flang-commits flang-commits at lists.llvm.org
Thu Oct 19 13:12:44 PDT 2023


================
@@ -97,6 +99,34 @@ class TypeBuilder {
 using namespace evaluate;
 FOR_EACH_SPECIFIC_TYPE(extern template class TypeBuilder, )
 
+/// A helper class to reverse iterate through the component names of a derived
+/// type, including the parent component and the component of the parents. This
+/// is useful to deal with StructureConstructor lowering.
+class ComponentReverseIterator {
+public:
+  ComponentReverseIterator(const Fortran::semantics::DerivedTypeSpec &derived) {
+    setCurrentType(derived);
+  }
+  /// Does the current type has a component with \name (does not look-up the
+  /// components of the parent if any). If there is a match, the iterator
----------------
clementval wrote:

```suggestion
  /// components of the parent if any)? If there is a match, the iterator
```

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


More information about the flang-commits mailing list