Week 6 - Allocatable Arrays and Extending Support for Array Operations

Hi back. This week, I worked on two things, completing allocatable arrays and extending support for array operations. The former is complete. The idea of passing and receiving char* from C runtime worked well. I have also supported allocatable arrays for almost all the types (integer, real, complex, etc.) except pointers. I also had a meeting with Ondrej where we discussed stuff related to automatic deallocation so that memory leak becomes impossible in lfortran. We came up with the idea of introducing ImplicitDeallocate which will contain the list of all allocatable local symbols and will be inserted just before the exit points of any particular scope (for example as the last statement of the function). For extending support for all array operations, I have refactored the code in array_op.cpp and added new tests for comparison and boolean operators. It has some bugs i.e., a common approach for all the operators may or may not work. I am looking into it. Though while working on array operations, I thought why even use nested loops when we are going to iterate over all the elements of the array. We can just traverse the 1D representation in the LLVM backend. I plan to discuss a bunch of my ideas for this with Ondrej in the next week’s meetings and will let you know the conclusions here.

That’s all for this week. Links to MRs below. Bye!

MR - !998

MR - !976


Jodhpur, Rajasthan, India