summaryrefslogtreecommitdiff
path: root/flang/runtime/allocatable.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [flang] Move runtime API headers to flang/include/flang/RuntimePeter Klausler2021-09-031-2/+2
| | | | | | | | | | | | Move the closure of the subset of flang/runtime/*.h header files that are referenced by source files outside flang/runtime (apart from unit tests) into a new directory (flang/include/flang/Runtime) so that relative include paths into ../runtime need not be used. flang/runtime/pgmath.h.inc is moved to flang/include/flang/Evaluate; it's not used by the runtime. Differential Revision: https://reviews.llvm.org/D109107
* [flang] Implement runtime Assign()peter klausler2021-08-091-4/+1
| | | | | | | | | | | | | | | | | | | | | | Define an API for, and implement, runtime support for arbitrary assignment of one descriptor's data to another, with full support for (re)allocation of allocatables with finalization when necessary, user-defined derived type assignment TBP calls, and intrinsic (default) componentwise assignment of derived type instances with allocation of automatic components. Also clean up API and implementation of finalization/destruction using knowledge gained while studying edge cases for assignment in the 2018 standard. The look-up procedure for special procedure bindings in derived types has been optimized from O(N) to O(1) since it will probably matter more. This required some analysis in runtime derived type description table construction in semantics and some changes to the table schemata. Executable Fortran tests have been developed; they'll be added to the test base once they can be lowered and run by f18. Differential Revision: https://reviews.llvm.org/D107678
* [flang] Run-time derived type initialization and destructionpeter klausler2021-07-201-5/+28
| | | | | | | | | | | | | | Use derived type information tables to drive default component initialization (when needed), component destruction, and calls to final subroutines. Perform these operations automatically for ALLOCATE()/DEALLOCATE() APIs for allocatables, automatics, and pointers. Add APIs for use in lowering to perform these operations for non-allocatable/automatic non-pointer variables. Data pointer component initialization supports arbitrary constant designators, a F'2008 feature, which may be a first for Fortran implementations. Differential Revision: https://reviews.llvm.org/D106297
* [flang] Runtime API for data pointerspeter klausler2021-07-191-0/+17
| | | | | | | Define and implement an API for use by lowering to implement operations on pointers. Differential Revision: https://reviews.llvm.org/D106170
* [flang] Implement more transformational intrinsic functions in runtimepeter klausler2021-05-201-1/+1
| | | | | | | | | | | | | | | | | Define APIs, naively implement, and add basic sanity unit tests for the transformational intrinsic functions CSHIFT, EOSHIFT, PACK, SPREAD, TRANSPOSE, and UNPACK. These are the remaining transformational intrinsic functions that rearrange data without regard to type (except for default boundary values in EOSHIFT); RESHAPE was already in place as a stress test for the runtime's descriptor handling facilities. Code is in place to create copies of allocatable/automatic components when transforming arrays of derived type, but it won't do anything until we have derived type information being passed to the runtime from the frontend. Differential Revision: https://reviews.llvm.org/D102857
* [flang] Update DE/ALLOCATE statement runtime message processingpeter klausler2021-03-121-4/+4
| | | | | | | Make error message descriptors on runtime DE/ALLOCATE API calls constant. Fix a bug in error message truncation/padding. Differential Revision: https://reviews.llvm.org/D98551
* [flang] Implement derived type description table encodingpeter klausler2020-12-081-1/+1
| | | | | | | | | | | | | | | | | | Define Fortran derived types that describe the characteristics of derived types, and instantiations of parameterized derived types, that are of relevance to the runtime language support library. Define a suite of corresponding C++ structure types for the runtime library to use to interpret instances of the descriptions. Create instances of these description types in Semantics as static initializers for compiler-created objects in the scopes that define or instantiate user derived types. Delete obsolete code from earlier attempts to package runtime type information. Differential Revision: https://reviews.llvm.org/D92802
* fix clang buildpeter klausler2020-11-121-2/+2
|
* [flang] Implement runtime support for basic ALLOCATE/DEALLOCATEpeter klausler2020-11-121-16/+51
| | | | | | | | Add error reporting infrastructure and support for ALLOCATE and DEALLOCATE statements of intrinsic types without SOURCE= or MOLD=. Differential revision: https://reviews.llvm.org/D91215
* [flang] Define CHARACTER runtime API, establish placeholder implementationspeter klausler2020-04-021-0/+45
formatting Original-commit: flang-compiler/f18@1d287d9d59eaee357db604dd9986c74c298a7b4d Reviewed-on: https://github.com/flang-compiler/f18/pull/1096