[flang-commits] [flang] [flang] Remove materialization workaround in type converter (PR #98743)
via flang-commits
flang-commits at lists.llvm.org
Mon Jul 15 06:00:46 PDT 2024
jeanPerier wrote:
> Note: Type conversions do not know the context in which they are converting a type. But each pattern can be initialized with a different type converter. That's the basic idea behind this PR.
>
> I tried the same for the workaround in `XReboxOpConversion`, but without success:
Yes, the handling of the fir.box type (Fotran descriptor) is context specific. It is lowered to an "unique pointer" to a struct type, except inside globals, where it is directly lowered to struct because memory cannot be manipulated in a static initializer and what we want to produce is the struct value itself.
I am not very happy with this context specific interpretation. The solution is probably to introduce new FIR types for the global contexts (which would push the contextual problem to lowering, so the end-to-end problem would not be much simpler).
https://github.com/llvm/llvm-project/pull/98743
More information about the flang-commits
mailing list