ayazhafiz
f52cca40b5
Dereference small (non recursive) tag unions before storing them elsewhere
...
Closes #2290
2021-12-29 17:55:21 -06:00
ayazhafiz
71bd77e3b2
Handle flat variants of recursive tag unions in repl
2021-12-29 17:55:21 -06:00
ayazhafiz
6da9a58b22
Remove some dead code
2021-12-29 17:55:21 -06:00
rvcas
d0c4072362
fix:(llvm): StrToNum is safer if we match on either a Union or a Struct
2021-12-29 16:26:15 -05:00
Folkert
d1bf07fdcd
be a bit less string in debug assert
2021-12-28 00:10:26 +01:00
ayazhafiz
5e5eb6dca8
(llvm) Generate code for tag unions less than 64 bits in size correctly
...
Previously, we assumed that a union layout always lived on >= 1 64-bit
boundary when generating an LLVM type for it. For small tags unions,
like `[ Ok i8, Err ]` this need not be the case; indeed, a tag union
like that is actually only 2 bits - 1 bit for the "i8" data, and one bit
of the tag kind.
This led to a discrepancy between what the layout IR and generated LLVM
code would assume about the size of tag unions. In the case above, the
layout IR would assume the tag data is 2 bits wide, and the tag id is 1
bit into the data. But the LLVM code would generate a type that was 65
bits wide, the first 64 bits being for the "i8" data and the last 1 bit
being for the tag kind.
Usually, just running the LLVM-emitted code would not present a problem.
But it does present a problem when we use the layout IR to inspect the
result of LLVM-run code, in particular when we try to look up the tag
ID, as the repl does. This patch fixes that issue.
Note that this bug did not present itself in `test_gen` previously
because the data that most tests check against is stored in the front of
the representation.
Closes #2149
2021-12-26 11:45:02 -06:00
Brian Carroll
e847c924dd
Lowlevels: replace RefCountGetPtr with the more general GetPtrAsInt.
2021-12-19 08:29:17 +00:00
Brian Carroll
c5d0a42c20
LLVM backend: set small string flag on empty string
2021-12-16 19:04:36 +00:00
Richard Feldman
ae755d81fa
Merge pull request #2153 from rtfeldman/llvm-build-macros
...
Cleanup dict/list element layout matches
2021-12-12 17:50:29 -05:00
satotake
a7fe2e3e53
Fix llvm Num.toFloat width conversion
...
Close #2156
2021-12-11 08:12:57 +00:00
Brian Carroll
7b6ba79eee
Merge branch 'trunk' of github.com:rtfeldman/roc into wasm-tags
2021-12-10 11:48:56 +00:00
Richard Feldman
aab601366e
Merge pull request #2152 from rtfeldman/inkwell-llvm-13
...
update inkwell to ease the llvm13 transition
2021-12-09 19:16:23 -05:00
Richard Feldman
1ce648ac27
Merge pull request #2116 from rtfeldman/str_to_num
...
Str.toNum
2021-12-09 09:48:38 -05:00
Brian Carroll
0220f7d921
Remove an assumption of 64-bit pointer alignment
2021-12-08 20:30:26 +00:00
Folkert
727f2f6e93
cleanup
2021-12-08 21:02:38 +01:00
Folkert
6c5f809678
cleanup
2021-12-08 21:00:53 +01:00
Folkert
40246607aa
update inkwell to ease the llvm13 transition
2021-12-08 19:36:29 +01:00
rvcas
2fa4ecd8ea
chore: clippy clippy clippy can't you see, sometimes your errors hypnotize me
2021-12-06 23:52:29 -05:00
rvcas
b7d48b2fe1
feat: add the rest of the num types for Str conversion
2021-12-06 23:24:02 -05:00
rvcas
bc5b1abcba
feat(Str.toNum): support decimal
2021-12-02 15:35:34 -05:00
Folkert
d6ed2147ae
basic working test case
2021-12-02 20:30:58 +01:00
rvcas
8a21b42c20
feat: check errorcode in returned record for a value greater than 0
2021-12-02 14:06:29 -05:00
rvcas
0d74daf7d9
feat: match on a Union Layout and use index access to get the num layout
2021-12-01 16:25:24 -05:00
Anton-4
e63701c5d1
trying to make Str.toNum work for Ints
2021-12-01 20:37:21 +01:00
Anton-4
2e21fd0cb9
Merge branch 'str-to-num' of github.com:rtfeldman/roc into str_to_num
2021-12-01 19:43:01 +01:00
Anton-4
c63c69f1ef
prep merge with Folkert's branch
2021-12-01 19:42:22 +01:00
Folkert
69fc1ad7e7
sketch of StrToNum
2021-12-01 15:33:16 +01:00
Anton-4
eaf4e57759
started on Str.toNum
2021-12-01 15:15:30 +01:00
Richard Feldman
e6bec46898
Merge pull request #2109 from rtfeldman/refactor-passed-function
...
refactor passed (to higher order lowlevel) funcion
2021-12-01 08:17:39 -05:00
Brian Carroll
a3827d6636
Merge pull request #2071 from rtfeldman/refcount-mono-ir
...
Start generating refcounting code as mono IR
2021-12-01 12:59:16 +00:00
Folkert
bec74c36c5
refactor passed (to higher order lowlevel) funcion
2021-11-30 21:50:27 +01:00
rvcas
f995a07029
feat: Num.toStr
...
* add type for Num.toStr
* create new lowlevel
* delete types and Symbol for fromInt and fromFloat
* leave LowLevel::{StrFromFloat,StrFromInt}
* match on LowLevel::NumToStr and figure out the layout to decide
which build function to delegate to
2021-11-30 14:52:06 -05:00
Brian Carroll
6e5acadfea
Create new lowlevels for refcounting
2021-11-30 09:57:00 +00:00
Brian Carroll
c8278dcb1c
Add a comment on REFCOUNT_MAX
2021-11-30 09:57:00 +00:00
Folkert
0bdda2506c
add update mode to reset and reuse
2021-11-28 14:13:02 +01:00
Richard Feldman
f80409800d
Merge pull request #2091 from rtfeldman/remove-empty-layouts
...
Remove empty layouts
2021-11-27 23:32:15 -05: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
Brian Carroll
a9456639c7
Fix a bug in LLVM backend refcounting
2021-11-27 00:10:54 +00:00
Folkert
dc44eaac97
cleanup
2021-11-21 14:11:18 +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 de Vries
25a64f4a57
Merge pull request #2032 from rtfeldman/joshuawarner32/internal-linkage
...
Use Internal linkage to keep roc function symbols in the final binary
2021-11-20 12:30:41 +01:00
Joshua Warner
45f9f800ef
Use Internal linkage instead of Private to keep roc function symbols in the final binary
2021-11-19 21:32:34 -08:00
Michael Downey
df91f63af8
changing const_zero to const_int
2021-11-19 07:24:07 -05:00
Michael Downey
51ad326d11
fmt
2021-11-16 17:30:04 -05:00
Michael Downey
d946b84e63
adding initial List.all
2021-11-16 16:34:36 -05:00
Richard Feldman
28273b67da
Merge pull request #1970 from rtfeldman/shrink-call-type
...
Shrink call type
2021-11-15 19:56:21 -08:00
satotake
c253273490
Merge branch 'trunk' into refactor-builtin-list-drop
2021-11-15 11:37:32 +00:00