This is an archive of the discontinued LLVM Phabricator instance.

[flang][hlfir] Fix hlfir.set_length codegen
ClosedPublic

Authored by jeanPerier on Apr 14 2023, 12:50 AM.

Details

Summary

The bufferization pass was propagating the raw alloca storage
(which may not allow to later retrieve the length) instead of
the hlfir variable value (which is guaranteed to hold the
character length).

Fix this and makes packageBufferizedExpr "storage" argument and
getBufferizedExprStorage return an hlfir::Entity to avoid similar
error in the future (the caller of packageBufferizedExpr will have
to think a bit when adding the explicit hlfir::Entity{} cast).

Diff Detail

Event Timeline

jeanPerier created this revision.Apr 14 2023, 12:50 AM
jeanPerier requested review of this revision.Apr 14 2023, 12:50 AM

LGTM. Thank you for the fix!

vzakhari accepted this revision.Apr 14 2023, 8:59 AM
This revision is now accepted and ready to land.Apr 14 2023, 8:59 AM
This revision was automatically updated to reflect the committed changes.