[flang] Load fir.ref<fir.class<T>> instead of creating a wrong box
authorValentin Clement <clementval@gmail.com>
Tue, 14 Mar 2023 20:44:41 +0000 (21:44 +0100)
committerValentin Clement <clementval@gmail.com>
Tue, 14 Mar 2023 20:45:20 +0000 (21:45 +0100)
commitfbca61c46612a6377b7d7cf5b56573df3c6759e2
treecd3319d5f145dc6103248411b1889614752cd6d6
parent1a90faacf1502fb967900ab44b62e8509a369013
[flang] Load fir.ref<fir.class<T>> instead of creating a wrong box

When a subroutine has an entry statement, the non-used argument
will be a fir.alloca and result in a fir.ref<fir.class<T>> for
polymorphic entities. In createBox, just load the box instead of
creating a wrong box.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D146079
flang/lib/Optimizer/Builder/FIRBuilder.cpp
flang/test/Lower/polymorphic.f90