Andrew Kelley
8ecd6c4d8c
add compiler note for bad int coercion
...
closes #3724
2019-11-26 19:50:52 -05:00
Michael Dusan
d20df7df09
stage1: fix bad intern counting
2019-11-25 20:41:17 -05:00
Michael Dusan
6b7e1085e3
Merge pull request #3774 from mikdusan/stage1-intern-housekeeping
...
stage1: consolodate interning
2019-11-25 19:19:32 -05:00
Andrew Kelley
4261fa3c49
move logic to the appropriate layers; add new compile error
2019-11-25 18:46:17 -05:00
Michael Dusan
6c89f96df1
stage1: consolodate interning
...
- merge const_void_val → intern.x_void
- move const_zero_byte → intern.zero_byte
- wrap intern access
2019-11-25 17:18:56 -05:00
Michael Dusan
a647a88dfc
const interning for 1-possible-value types
2019-11-25 15:04:49 -05:00
Michael Dusan
8f3e972da6
unembed ZigValue from IrInstruction
2019-11-25 15:04:39 -05:00
Michael Dusan
acd95546b7
rename ConstExprValue → ZigValue
2019-11-25 15:04:29 -05:00
Andrew Kelley
29e438fd1f
more sentinel-terminated pointers std lib integration
...
See #3767
2019-11-25 00:43:36 -05:00
Andrew Kelley
15d415e10b
make std.mem.toSlice use null terminated pointers
...
and fix the fallout
2019-11-24 21:21:05 -05:00
Andrew Kelley
34b1ebefaa
Merge remote-tracking branch 'origin/master' into null-terminated-pointers
2019-11-24 20:28:46 -05:00
Andrew Kelley
b9f88c3552
fix compile errors for array sentinels mismatching
2019-11-24 20:25:14 -05:00
Andrew Kelley
7eb5acdc80
fix casting [N:x]T to [N]T memcpying too many bytes
2019-11-24 18:57:07 -05:00
Andrew Kelley
217a5090ff
fix compile error regressions
2019-11-24 18:10:31 -05:00
Andrew Kelley
c96d565166
add compile error for incompatible pointer sentinels
2019-11-24 17:02:56 -05:00
Andrew Kelley
09ec720dab
fix comptime @ptrCast of pointers to arrays
2019-11-24 16:25:26 -05:00
Andrew Kelley
44b1dc6db8
add type coercion: [:x]T to [*:x]T
2019-11-24 15:17:55 -05:00
Andrew Kelley
4c7b52503b
all tests passing
2019-11-24 02:14:21 -05:00
Andrew Kelley
f25182f46d
structs can have fields with type var
...
behavior tests passing now
2019-11-23 17:51:37 -05:00
Vexu
89310dad56
Merge branch 'master' into modernize-stage2
2019-11-23 23:01:28 +02:00
Michael Dusan
29d7b5a80c
remove UTF BOM
2019-11-23 14:17:55 -05:00
Vexu
03cc81665b
Merge branch 'master' into modernize-stage2
2019-11-23 19:13:48 +02:00
Andrew Kelley
7597735bad
update the stage1 implementation to the new proposal
...
See #3731
2019-11-23 04:45:35 -05:00
Vexu
4d9318cee0
fix missing implicit cast in return instruction
2019-11-21 23:21:51 -05:00
Vexu
0b63573674
improve broken llvm module error message
2019-11-21 23:21:14 -05:00
Timon Kruiper
94299d16d1
Stage1: Add compile error for an empty switch on a integer
2019-11-22 04:00:47 +00:00
Andrew Kelley
fd6020c4e2
update tests, better error messages, update self-hosted tokenizer
2019-11-21 20:43:41 -05:00
Andrew Kelley
cf2fe2536e
better error message when null termination does not match
2019-11-21 20:43:41 -05:00
Andrew Kelley
47f06be369
string literals are now null terminated
...
this also deletes C string literals from the language, and then makes
the std lib changes and compiler changes necessary to get the behavior
tests and std lib tests passing again.
2019-11-21 20:43:41 -05:00
Andrew Kelley
21f344b3b9
add null terminated pointers and arrays to self-hosted
...
as well as `@typeInfo` and `@Type`
2019-11-21 20:43:41 -05:00
Andrew Kelley
1aa978f32e
implement null terminated pointers
2019-11-21 20:43:41 -05:00
daurnimator
ed956b5812
translate-c: add support for MacroQualified definitions
2019-11-19 01:05:17 +00:00
Andrew Kelley
57b8614a5a
Merge pull request #3697 from Vexu/container-docs
...
Implement container level doc comments
2019-11-17 22:31:12 +00:00
daurnimator
4e28d7a5f7
fix bug on empty error union
2019-11-17 22:29:49 +00:00
LemonBoy
924dd674e2
Catch invalid type from peer resolution
...
Fixes #3703
2019-11-17 22:25:14 +00:00
Vexu
6cddf9d723
properly parse anon literal in array
2019-11-17 22:24:21 +00:00
Vexu
977b613881
add container doc comments to generated docs
2019-11-15 15:17:59 +02:00
Vexu
e509d21f39
implemented container doc comments in stage 1
2019-11-15 15:02:51 +02:00
LemonBoy
a11da37734
Update discriminant value also for zero-sized unions
...
Fixes #3681
2019-11-14 17:07:20 +00:00
Andrew Kelley
d89f39d719
rework layout of struct type fields
...
This removes the remaining hack in the implementation of anonymous
struct literals, and they can now therefore now have greater than 16
fields/elements.
2019-11-14 03:52:39 -05:00
Andrew Kelley
f2f698a888
rework comptime struct value layout, removing 1/2 hacks
...
in the implementation of anonymous struct literals
2019-11-14 03:52:36 -05:00
Vexu
b83ce08a3b
add compile error for @atomicRmw on enum not being an .Xchg
2019-11-13 18:48:31 +00:00
Andrew Kelley
8bae70454d
Merge pull request #3675 from Vexu/atomic-store
...
Add @atomicStore builtin
2019-11-13 03:06:55 +00:00
Andrew Kelley
32b37e695a
fix anonymous struct literal assigned to variable
...
closes #3667
2019-11-12 21:57:25 -05:00
Andrew Kelley
37318bf151
fn parameters participate in result location semantics
...
See #3665
2019-11-12 18:55:17 -05:00
Vexu
41914321b4
fix comptime atomicStore and add tests
2019-11-13 01:32:16 +02:00
Vexu
110ef2e528
add @atomicStore builtin
2019-11-13 00:25:44 +02:00
Andrew Kelley
e32b4829f4
Merge pull request #3670 from Vexu/atomics-enum
...
Support atomic operations with enums
2019-11-12 17:45:29 +00:00
Andrew Kelley
710ccacfa3
fix assertion failure in ptrToInt
...
found by building pluto
2019-11-12 12:21:20 -05:00
Vexu
7e5b234b8b
support atomic operations with enums
2019-11-12 17:13:33 +02:00