Lower allocate statement with MOLD= to calls to the Fortran
runtime. PointerApplyMold and AllocatableApplyMold are called
depending on the object to be allocated.
Details
- Reviewers
jeanPerier PeteSteinfeld - Commits
- rG2cd2b6a7b546: [flang] Lower allocation with MOLD
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Apart from the error condition case handling, looks good to me.
flang/lib/Lower/Allocatable.cpp | ||
---|---|---|
224 | I do not get why this is returning a value, it seems AllocatableApplyMold returns void [1]. | |
579 | I think AllocatableApplyMold will set the status to unallocated regardless of the previous allocation. We should somehow preserve this info so that the program can crash/recover as needed if the allocatable is not deallocated to start with (9.7.1.3 point 1, first bullet point). Maybe AllocatableApplyMold should actually be the one doing this check like with some other entry points. |
Return from AllocatableApplyMold if the descriptor is
allocated so the error can be caught by AllocatableAllocate
to respect the first bullet of 9.7.1.3 point 1.
clang-format issue in flang/lib/Lower/Allocatable.cpp somewhere, looks great otherwise.
I saw one clang-format diff. Otherwise, all builds and tests correctly and looks good.
flang/lib/Lower/Allocatable.cpp | ||
---|---|---|
216–217 | I get a clang-format diff here. |
I get a clang-format diff here.