flang-compiler / f18

F18 is a front-end for Fortran intended to replace the existing front-end in the Flang compiler
230 stars 48 forks source link

First cut at runtime API for allocatable management #1070

Closed klausler closed 4 years ago

klausler commented 4 years ago

As we did with runtime I/O APIs, here's an initial interface spec for allocatables encoded in the form of a header file of prototypes with lots of commentary. I haven't tried to compile this header or use it in any other way; it's meant to generate discussion, (dis)approval, and (one hopes) better ideas or identification of missing capabilities.

As was the case with I/O, I'm trying to push complexity into the implementation of the runtime in order to simplify the form of the generated code, so that the API and compiler-generated code can be smaller and more stable over time; I'd rather we fix bugs with derived type reallocation and finalization in the runtime than in generated code, for example.

Pointers, actual argument temporaries, adjustables, &c. will use a similar API, probably with renaming for generality, but I'd like to get general agreement on the API for allocatables before trying to generalize further. Assume that all of the names can change, they're not as important as their arguments.