Commit graph

39 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
Folkert
90e90b3b22
fix dec equality 2022-04-08 13:03:19 +02:00
Folkert
b146a2cf5f
fix string equality 2022-03-26 18:29:46 +01:00
Brendan Hansknecht
cdf19e3feb
Merge pull request #2698 from rtfeldman/i/2696
Make sure casting to unsigned types performs zero-extension
2022-03-10 20:10:33 -08:00
ayazhafiz
a90bba3d1d Make sure casting to unsigned types performs zero-extension
Closes #2696
2022-03-10 17:39:37 -06:00
Folkert
d222be95b3
fix another merge conflict 2022-03-10 21:38:31 +01:00
Folkert
e90c12ba1f
Merge remote-tracking branch 'origin/trunk' into box-all-the-things 2022-03-10 18:01:09 +01:00
Folkert
29e053abf3
clarify basic_type_from_layout function 2022-03-09 19:01:03 +01:00
Folkert
5d15166bb5
rename 2022-03-09 16:33:36 +01:00
Folkert
768703c5df
update reporting; suggestions now have Box in scope 2022-03-09 16:12:11 +01:00
Folkert
92f2927046
initial implementation 2022-03-08 19:09:42 +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
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
a1fd34feef remove empty layout types (list,str,dict,set) 2021-11-27 14:05:16 +01:00
Folkert
7d231f87cd remove usize llvm gen 2021-11-21 13:24:53 +01:00
Folkert
123c963ff1 llvm build working 2021-11-21 00:23:59 +01:00
Folkert
c4ec9aa898 working mono 2021-11-20 23:25:30 +01:00
Folkert
8266284567 clippy 2021-11-08 22:31:08 +01:00
Folkert
bd0f02c542 another waypoint 2021-11-06 19:27:16 +01:00
Brendan Hansknecht
0c6f8f308f Remove f16. It is not really supported by modern CPU hardware. 2021-09-21 16:51:47 -07:00
Folkert
350891468a add LambdaSet layout variant 2021-09-12 17:00:09 +02:00
Folkert
ce6ab15139 use usize instead of i64 in hash and compare 2021-08-25 20:47:03 +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
cb42f0c039 Merge remote-tracking branch 'origin/trunk' into add-dec-types 2021-07-18 16:54:38 +02:00
Folkert
c57913f767 fix hash and compare 2021-07-17 22:00:57 +02:00
Folkert
0171fd0959 remove Boxed 2021-07-14 15:33:59 +02:00
Folkert
09f01ba193 Boxed skeleton 2021-07-12 17:01:53 +02:00
Jared Ramirez
67eef2c97f Merge branch 'trunk' of https://github.com/rtfeldman/roc into add-dec-types 2021-07-08 16:47:42 -07:00
Folkert
978cea4b8a passing tests 2021-06-28 22:28:47 +02:00
Folkert
3e53f0a14d cleanup 2021-06-27 20:37:44 +02:00
Folkert
16f6259f7f fix all the things 2021-06-27 14:39:28 +02:00
Folkert
98a9dc0945 remove tag id from data bytes for non-recursive tags 2021-06-26 17:01:23 +02:00
Jared Ramirez
ecb89da7b8 Add basic Dec operations 2021-06-25 10:25:03 -07:00
Jared Ramirez
4d6e5a1a4f [WIP] Add Dec/Decimal builtin types 2021-06-23 19:30:16 -07:00
Folkert
f2f9897187 remove FunctionPointer completely 2021-06-19 15:04:28 +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/compare.rs (Browse further)