This is an archive of the discontinued LLVM Phabricator instance.

[flang][hlfir] Support polymorphic hlfir.expr values.
ClosedPublic

Authored by vzakhari on Jul 17 2023, 9:09 PM.

Details

Summary

This patch sets 'polymorphic' attribute of hlfir::ExprType when
the value is created from a polymorphic entity.
Memoization of such ExprType involves creating a mutable descriptor
on the stack, which is initialized (as a null box) and passed to
AllocatableApplyMold with the mold being the entity from which
the ExprType value is being created.

This patch fixes "creating polymorphic temporary" TODO and also
several cases of "'fir.convert' op invalid type conversion" error.

Diff Detail

Event Timeline

vzakhari created this revision.Jul 17 2023, 9:09 PM
vzakhari requested review of this revision.Jul 17 2023, 9:09 PM
tblah accepted this revision.Jul 18 2023, 3:12 AM

Looks good to me

This revision is now accepted and ready to land.Jul 18 2023, 3:12 AM
This revision was automatically updated to reflect the committed changes.