Pointer association with an unlimited polymorphic pointer on the lhs
requires more than just updating the base_addr. Delegate the association to
the runtime function PointerAssociation.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
flang/lib/Lower/Bridge.cpp | ||
---|---|---|
2721 | Does the right hand side always have to be an allocatable/pointer if the left hand side is unlimited polymorphic ? If so, I think it would be worth adding a standard reference here. | |
flang/test/Lower/polymorphic.f90 | ||
145 | Sorry, I misunderstood your question earlier. I do not think it is OK to allow convertion from fir.ref<fir.box<>> to fir.box<none>. It is cheating the SSA value model of fir.box. Any following code would thing the convert results is immutable while it is not since the convert operand can be modified. So I think you have to load and then cast to a fir.box<None> here. I know that will imply making a copy of the descriptor, which is useless here, but we should fix that in a more generic way by skipping the copy in the fir.load codegen if we know we can. |
flang/test/Lower/polymorphic.f90 | ||
---|---|---|
145 | Makes sense. I'll update the code to include the load if necessary. |
Does the right hand side always have to be an allocatable/pointer if the left hand side is unlimited polymorphic ? If so, I think it would be worth adding a standard reference here.