This is an archive of the discontinued LLVM Phabricator instance.

[flang] Implement runtime support for basic ALLOCATE/DEALLOCATE
ClosedPublic

Authored by klausler on Nov 10 2020, 3:15 PM.

Details

Summary

Add error reporting infrastructure and support for ALLOCATE
and DEALLOCATE statements of intrinsic types without SOURCE=
or MOLD=.

Diff Detail

Event Timeline

klausler created this revision.Nov 10 2020, 3:15 PM
Herald added a project: Restricted Project. · View Herald Transcript
klausler requested review of this revision.Nov 10 2020, 3:15 PM
jeanPerier added inline comments.Nov 12 2020, 6:54 AM
flang/runtime/allocatable.cpp
52

I finally was able to test end-to-end and there is a very sneaky issue here, auto dim is making a copy of the dimension instead of taking it by reference (at least for me using gcc 8.3, I do not know what is the C++ type resolution here).
Both:
auto& dim{descriptor.GetDimension(zeroBasedDim)};
or
descriptor.GetDimension(zeroBasedDim).SetBounds(lower, upper);
fixed the issue for me.

klausler updated this revision to Diff 304853.Nov 12 2020, 8:46 AM

Fix bug noticed by Jean.

jeanPerier accepted this revision.Nov 12 2020, 10:12 AM

Thanks, looks good to me.

This revision is now accepted and ready to land.Nov 12 2020, 10:12 AM
This revision was landed with ongoing or failed builds.Nov 12 2020, 10:22 AM
This revision was automatically updated to reflect the committed changes.