mirror of https://github.com/tbklang/tlang.git
Stack-based array support #102
Labels
No Label
dependency
emit
hashmapper
lebanonmapper
lexer
meta
needsfix
parser
qol
question
resolution
typing
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
Blocks
#81 Array support
tlang/tlang
Reference: tlang/tlang#102
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What is this?
We want to add support for doing the followjg declaration in T:
What this entails:
int[2]
(which is different to say now,int[3]
), this should also make a stack-based array.myArray
should become a pointer tomyArray
I need to look at this stuff.
We will need to add the following:
Value
and is calledStackArrayIndexInstruction
StackArrayIndexInstruction
in DGenStackArrayAssignmentInstruction
generated which holds aStackArrayIndexInstruction
as left-hand side and aValue
instruction as right-hand side (the assignment)All of the above were completed in commit
98b3ab42848e940ef60a21f2755178148338ba6f
.New instructions ✅
There are a few new instructions we are using now:
StackArrayIndexInstruction
This is used to disambiguiate between the
ArrayIndex
for pointer-based arrays and the stack-based array indexesStackArrayIndexInstruction
:Available in commit
270ca64106e98358d474efff5bde9e5402f4362c
.StackArrayIndexAssignmentInstruction
This is used for assigning into a stack-based array.
Available in commit
b8612ebbc852f8aba6f257d53fa876b0593b20c3
.We have this working now in
98b3ab42848e940ef60a21f2755178148338ba6f
, stack arrays seem to be working.I'm closing this now as #81 (super issue) is closing. This seems to work as expected.