Commit graph

44 commits

Author SHA1 Message Date
Anton-4
eee85fa45d
moved all crates into seperate folder + related path fixes 2022-07-01 17:37:43 +02:00
Richard Feldman
4eec34becf
Update to use new square brace formatting 2022-05-22 23:15:54 -04:00
Folkert
61aeaefc76
a start with 32-bit linux support 2022-03-30 23:55:34 +02:00
Folkert
94b5abf2ce
fix spelling 2022-03-30 17:43:11 +02:00
Folkert
8eff983e53
clippy 2022-03-30 17:37:06 +02:00
Folkert
20104a1159
propagate attributes from builtins to call sites 2022-03-30 17:32:48 +02:00
Folkert
fd209f90ff
fix bug where incorrect stack size is given 2022-03-30 17:25:28 +02:00
Folkert
14accf4589
clippy 2022-03-27 16:22:46 +02:00
Folkert
13ab2010f0
patch List.countGraphemes and List.isEmpty with the byval() attribute 2022-03-27 16:20:46 +02:00
Folkert
71c11784a0
step 1: Deriv works and has no valgrind problems 2022-03-26 17:56:56 +01:00
Folkert
d7a5cd7b11
some debugging niceties 2022-03-13 00:12:16 +01:00
Brian Carroll
456d8ff9cb Merge branch 'trunk' of github.com:rtfeldman/roc into list-str-capacity 2022-03-11 19:28:13 +00:00
ayazhafiz
a90bba3d1d Make sure casting to unsigned types performs zero-extension
Closes #2696
2022-03-10 17:39:37 -06:00
Folkert
07063a8e18
Merge remote-tracking branch 'origin/trunk' into list-str-capacity 2022-03-09 14:36:34 +01:00
ayazhafiz
e52d427ac8 Hash record field name order in generated layouts
Closes #2535

See the referenced issue for longer discussion - here's the synopsis.
Consider this program

```
app "test" provides [ nums ] to "./platform"

alpha = { a: 1, b: 2 }

nums : List U8
nums =
    [
        alpha.a,
        alpha.b,
    ]
```

Here's its IR:

```
procedure : `#UserApp.alpha` {I64, U8}
procedure = `#UserApp.alpha` ():
    let `#UserApp.5` : Builtin(Int(I64)) = 1i64;
    let `#UserApp.6` : Builtin(Int(U8)) = 2i64;
    let `#UserApp.4` : Struct([Builtin(Int(I64)), Builtin(Int(U8))]) = Struct {`#UserApp.5`, `#UserApp.6`};
    ret `#UserApp.4`;

procedure : `#UserApp.nums` List U8
procedure = `#UserApp.nums` ():
    let `#UserApp.7` : Struct([Builtin(Int(I64)), Builtin(Int(U8))]) = CallByName `#UserApp.alpha`;
    let `#UserApp.1` : Builtin(Int(U8)) = StructAtIndex 1 `#UserApp.7`;
    let `#UserApp.3` : Struct([Builtin(Int(I64)), Builtin(Int(U8))]) = CallByName `#UserApp.alpha`;
    let `#UserApp.2` : Builtin(Int(U8)) = StructAtIndex 1 `#UserApp.3`;
    let `#UserApp.0` : Builtin(List(Builtin(Int(U8)))) = Array [`#UserApp.1`, `#UserApp.2`];
    ret `#UserApp.0`;
```

What's happening is that we need to specialize `alpha` twice - once for the
type of a narrowed to a U8, another time for the type of b narrowed to a U8.

We do the specialization for alpha.b first - record fields are sorted by
layout, so we generate a record of type {i64, u8}. But then we go to
specialize alpha.a, but this has the same layout - {i64, u8} - so we reuse
the existing one! So (at least for records), we need to include record field
order associated with the sorted layout fields, so that we don't reuse
monomorphizations like this incorrectly!
2022-02-21 14:10:45 -05:00
Folkert
1c0d092c48
fix str_to_utf8 2022-02-20 01:10:09 +01:00
Folkert
dea6cfbc8f
various fixes 2022-02-20 00:20:50 +01:00
ayazhafiz
13067f2908 Implement Num.toNNNChecked
Closes #2411
2022-02-19 16:20:21 -05:00
Folkert
3d7254726d
WIP 2022-02-18 23:33:24 +01:00
Folkert
5582644166
use str/list helpers to prepare for adding capacity 2022-02-18 22:23:05 +01:00
Folkert
40246607aa update inkwell to ease the llvm13 transition 2021-12-08 19:36:29 +01:00
Folkert
79d5c82dfb cleanup 2021-11-27 16:36:43 +01:00
Folkert
196538cc58 fix valgrind error, finally 2021-11-13 01:00:20 +01:00
Folkert
38da99b1ac make it work 2021-11-11 23:36:35 +01:00
Folkert
8266284567 clippy 2021-11-08 22:31:08 +01:00
Folkert
0e1e3381f0 Merge remote-tracking branch 'origin/trunk' into tag-union-imitate-rust 2021-11-07 15:29:55 +01:00
Kevin Sjöberg
f6d055dc62 Correct minor spelling mistakes 2021-11-06 15:29:08 +01:00
Folkert
5cd232816b waypoint 2021-11-05 21:30:20 +01:00
Folkert
e378f0d2f9 fix tags tests 2021-11-05 10:35:17 +01:00
Folkert
bd7ce52e26 only unwrap lambda set at the last moment 2021-09-14 22:20:14 +02:00
Folkert
e31f5d4fa0 more cleanup 2021-08-18 18:38:18 +02:00
Folkert
c09b3b89f3 test_gen works again 2021-08-18 13:46:09 +02:00
Folkert
ceb5cc66fa use IdentStr 2021-08-03 21:14:36 +02:00
Folkert
899cbeabd7 fix extra ampersands 2021-07-29 17:32:08 +02:00
Folkert
3e53f0a14d cleanup 2021-06-27 20:37:44 +02:00
Folkert
98a9dc0945 remove tag id from data bytes for non-recursive tags 2021-06-26 17:01:23 +02:00
Folkert
e2a3e6792d add assert 2021-06-25 22:37:30 +02:00
Folkert
fd9b826398 fix the issues 2021-06-25 22:27:11 +02:00
Folkert
a05d8b52c0 make things compile 2021-06-24 20:31:14 +02:00
Folkert
2355bbf815 updates 2021-06-24 20:25:06 +02:00
Folkert
f8bdf05f90 has_tag_id from zig 2021-06-24 20:12:05 +02:00
Folkert
f2f9897187 remove FunctionPointer completely 2021-06-19 15:04:28 +02:00
Folkert
d5f89ccbe6 fix calling conventions 2021-06-09 23:37:26 +02:00
Richard Feldman
57676057fa Rename gen to gen_llvm
This way, we have gen_dev and gen_llvm representing the two
different compiler backends.
2021-06-06 07:56:47 -04:00
Renamed from compiler/gen/src/llvm/bitcode.rs (Browse further)