Commit graph

1161 commits

Author SHA1 Message Date
Ayaz Hafiz
a3de22c88a
Do not fixup recursion pointers in non-recursive lambda sets
If a lambda set is non-recursive, but contains naked recursion pointers,
we should not fill those naked pointers in with the slot of the lambda
set during interning. Such naked pointers must belong to an encompassing
lambda set that is in fact recursive, and will be filled in later.

For example, `LambdaSet([Foo, LambdaSet(Bar, [<rec>])] as <rec>)` should
not have the inner lambda set's capture be filled in with itself.

Also, during reification of recursion pointers, we do not need to
traverse re-inserted lambda sets again, since they were just fixed-up.

Closes #5026
2023-02-13 17:14:04 -06:00
Ayaz Hafiz
2903ec4ac2
Remove obsolete comments 2023-02-13 10:54:05 -06:00
J.Teeuwissen
8721ae73e8
switch logic 2023-02-11 16:17:13 +01:00
Folkert
587c5c18d7
mono refcount: use box instaed of non-nullable unwrapped 2023-02-10 20:19:49 +01:00
J.Teeuwissen
20af312818
VarRcType 2023-02-10 15:32:59 +01:00
J.Teeuwissen
26a9b919d9
simplified insert_refcount_stmt 2023-02-10 13:12:10 +01:00
Folkert
6c15284a8f
more wip; now we just need to generate the exposed procs at the right time 2023-02-08 22:56:38 +01:00
Ayaz Hafiz
a22dcb5784
Unify record and tuple access 2023-02-08 11:13:36 -05:00
Ayaz Hafiz
1ee5f9d02b
Unify logic for building record and tuple IR 2023-02-08 11:03:02 -05:00
J.Teeuwissen
ae499137e4
start right to left evaluation with environment 2023-02-08 15:01:35 +01:00
J.Teeuwissen
1fa96257ed
clear work tree 2023-02-08 12:38:06 +01:00
Joshua Warner
5a6be05ead
implement mono / lowering for tuples 2023-02-07 18:54:50 -08:00
Ayaz Hafiz
0af5929411
Add comments for debug reprs 2023-01-30 17:22:16 -06:00
Ayaz Hafiz
4a59e24081
Address lints 2023-01-30 16:48:46 -06:00
Ayaz Hafiz
8c68044c54
Prime the cache with a default layer 2023-01-30 16:48:01 -06:00
Ayaz Hafiz
c3064dad73
Add method to get index of interned layout 2023-01-30 15:53:37 -06:00
Ayaz Hafiz
c1a937e393
Add method to debug whole nested structure of interned layout 2023-01-30 15:53:13 -06:00
Ayaz Hafiz
a16ea95a04
Always start off with an empty cache
Adding a cache layer can only be done with a snapshot and rollback.
This is necessary to prevent extra variables just lying around on the
toplevel of the layout cache.
2023-01-30 13:08:21 -06:00
Ayaz Hafiz
1e22a2bbcd
Layout-cache variable invalidation must compare by root keys
After unification, variable roots can change. So, when we invalidate
entries in the layout cache, we must compare for variable equivalence
relative to the current state of subs.
2023-01-30 13:06:44 -06:00
Ahmad Sattar
f80edb6ed6
Put list_element_layout! macro into mono 2023-01-28 02:01:02 +01:00
Ayaz
0672879fff
Merge pull request #4965 from roc-lang/recursive-layouts-rec-by-default
Support equivalence for finding lambda sets
2023-01-26 15:20:59 -06:00
Brian Carroll
e0b5247f3e
mono code_gen_help: decref should use element alignment, not List alignment 2023-01-26 20:05:16 +01:00
Brian Carroll
7228502965
mono: delete is_rc_implemented_yet, because everything is implemented! 2023-01-26 20:05:16 +01:00
J.Teeuwissen
957f44966c
start perceus reference count 2023-01-26 17:13:29 +01:00
Ayaz Hafiz
a294cae9cd
Don't store recursive unions by recursive pointer head-on 2023-01-25 18:05:43 -06:00
Ayaz Hafiz
36beda63ba
Lints 2023-01-25 18:00:32 -06:00
Ayaz Hafiz
478d4a2d44
Support lambda sets with recursive pointers and their equivalence-checking 2023-01-25 17:57:49 -06:00
Ayaz Hafiz
fa47e82d72
Implement equivalence of lambda sets 2023-01-25 17:20:42 -06:00
Ayaz Hafiz
61b11c9882
Single-threaded layout interner should resolve recursive pointer 2023-01-25 17:19:39 -06:00
Ayaz Hafiz
44acb7e047
Update recursive layout tests 2023-01-25 17:19:14 -06:00
Ayaz Hafiz
aab626bf3f
Remove resolve_recursive_layout 2023-01-25 16:21:05 -06:00
Ayaz Hafiz
7754cc553c
Turn the ir-checker back on 2023-01-25 16:18:47 -06:00
Ayaz Hafiz
c9afbce053
Add an up-to-isomorphism equivalence checker for layouts 2023-01-25 16:17:30 -06:00
Ayaz Hafiz
cb00619ce3
Return normalized representation of recursive union as the rec ptr 2023-01-25 15:16:48 -06:00
Ayaz Hafiz
741b1a1bd5
Always show one level of unions when printing layouts 2023-01-25 15:16:06 -06:00
Ayaz Hafiz
3382be6cb9
Chase recursive layouts as appropriate 2023-01-25 15:10:56 -06:00
Folkert
3417a0e059
fix silent merge request wrt record accessors 2023-01-25 00:02:19 +01:00
Ayaz
ad84e02abf
Merge pull request #4950 from roc-lang/keep-recptr-index
Initial support for linking recursive pointer layouts back to their source layouts
2023-01-24 14:42:00 -06:00
Folkert de Vries
8e5efe67b4
Merge pull request #4912 from roc-lang/remove-polymorphic-expression-compilation
Rip out polymorphic expression compilation
2023-01-24 21:35:08 +01:00
Folkert de Vries
7aaf0f3822
Merge pull request #4916 from roc-lang/rust1_65
upgrade to rust 1.65 and clippy fixes
2023-01-24 14:14:10 +01:00
Ayaz Hafiz
7f284a753b
Lints 2023-01-23 17:09:05 -06:00
Ayaz
a7c415dc35
Merge pull request #4940 from joshuawarner32/tuple-solve
Initial implementation of tuples in type checking
2023-01-23 16:25:35 -06:00
Ayaz Hafiz
efd7d71dc4
Use Layout::NAKED_RECURSIVE_PTR and update comments 2023-01-23 16:10:54 -06:00
Ayaz Hafiz
8edbd3b378
Eliminate uses of RECURSIVE_PTR directly 2023-01-23 16:04:55 -06:00
Ayaz Hafiz
37d9307fbf
Call insert_recursive for union layouts 2023-01-23 15:40:40 -06:00
Ayaz Hafiz
59144f6e29
Unused var 2023-01-23 14:37:49 -06:00
Ayaz Hafiz
695b2e6363
Fix a bug by not recording normalized layouts 2023-01-23 14:37:49 -06:00
Ayaz Hafiz
7169d0974d
Add support for interning normalized recursive layouts 2023-01-23 14:37:49 -06:00
Ayaz Hafiz
8750127111
Begin support for looping-back recursive pointers to their source layouts 2023-01-23 14:37:48 -06:00
Anton-4
1f2b39a521
Merge branch 'main' of github.com:roc-lang/roc into rust1_65 2023-01-23 18:27:33 +01:00