Skip to content
Unverified Commit 67f9b5ae authored by Valentin Clement (バレンタイン クレメン)'s avatar Valentin Clement (バレンタイン クレメン) Committed by GitHub
Browse files

[flang] Fix issue with lookup in the binding table (#74416)

This patch is fixing two issue relative to the dynamic dispatch for
polymorphic entities.

1. Fix the `requireDispatchCall` function. It was checking for the first
symbol of the component but this is not the one to be checked. Instead
the last symbol of the base of the component object is the one to check
to know if it is polymorphic object with a dispatch call or not. This is
demonstrated in the new added test in `flang/test/Lower/dispatch.f90`
where the first symbol would point to `q` which is monomorphic and would
result in a simple `fir.call`
2. Fix the pass object in a no pass situation. In a no pass situation
the pass object is lowered anyway to be able to do the lookup in the
binding table. It was previously lowered wrongly an lead to unresolved
lookup. The base of the component is the passed object and should be
lowered. To achieve this, the `gen(DataRef)` entry point is exposed form
`ConvertExprToHLFIR` through a `convertDataRefToValue` function. The
same test added in `flang/test/Lower/dispatch.f90` is checking for the
correct passed object.

In addition couple of tests were updated to HLFIR since the lowering
used only works with it.
parent 2a95d47e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment