[flang] Fix output type when emboxing intrinsic type to unlimited polymorphic box
authorValentin Clement <clementval@gmail.com>
Mon, 13 Feb 2023 14:41:19 +0000 (15:41 +0100)
committerValentin Clement <clementval@gmail.com>
Mon, 13 Feb 2023 14:41:48 +0000 (15:41 +0100)
commita01edb169bb06c2091b6c9fe6d7a9f07fc673766
tree2038de3c555e28efe44b36488556907576b74f61
parentcc4fb5837647d913e1c1df5ff398be2896ea6d07
[flang] Fix output type when emboxing intrinsic type to unlimited polymorphic box

When emboxing an intrinsic type to a polymorphic descriptor, directly set its
type to `fir.class<none>`.

`fir.class<i32>` is not a real type used anywhere in lowering so make it right directly
avoid unnecessary convert op to `fir.class<none>`. Also `fir.class<i32>` would not be
recognized as unlimited polymorphic.

Reviewed By: jeanPerier, PeteSteinfeld

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