lfortran
lfortran copied to clipboard
Finalization TODO
After merging this #8871, We'll be able to say that we have a good finalization process that's working properly (for fortran types). Here's a full todo to perfect it.
- [ ] Use Functions to finalize types -- (e.g.
finalize_alloatable_scalar,finalize_derivedType_tt,finalize_descriptorArray). This will make us have smaller binaries + will resolves the issue of recursive derived types declaration ( referenceintegration_tests/derived_types_78.f90). - [ ] Handle the case of block symbol having a
returnstatement. We need to finalize any sub-constructs in a super-construct if we usereturnin them (referenceintegration_tests/finalization_01.f90). - [x] Remove unnecessary labels #8844.
- [ ] Add a utility to print out the amount of allocated VS Freed heap memory and what is the purpose of allocating that memory -- To find leaks and investigate memory usages.
- [ ] Add Finalization functions in the VTable of the types -- To handle the case of unlimited polymorphic type in Fortran
class(*)-- remember that it could be an array.
I think we also need to use the same utilities of finalization with deallocate statement, as it for sure leaks now.
As we'll end up having LLVM-finalization function per type, things should get easier.