4457 Commits

Author SHA1 Message Date
Veikka Tuominen
9ca9819488
Merge pull request #6883 from Vexu/translate-c
translate-c: correctly handle pointers to opaque demoted structs
2020-10-31 15:25:14 +02:00
Vexu
28a0583b84
run zig fmt on src/ and test/ 2020-10-31 12:21:49 +02:00
Veikka Tuominen
7c8d9cfa40
Merge pull request #6660 from Vexu/stage2
Stage2 switch and package imports
2020-10-31 09:39:28 +02:00
Vexu
3ff381385a
translate-c: correctly handle pointers to opaque demoted structs 2020-10-31 09:30:13 +02:00
Travis
bb6e39e274 remove extra space in .** error message 2020-10-30 21:26:05 +02:00
Veikka Tuominen
80dd432137
Merge pull request #6858 from travv0/no-star-after-dot-star
don't allow a token starting with an asterisk directly following .*
2020-10-30 16:08:04 +02:00
Vexu
22ec5e0859
stage2: fix typo in liveness; add comptime switch test 2020-10-30 15:58:13 +02:00
Vexu
4ed2c52fb7
stage2: switch put swap condbr and block
condbr is noreturn so having the other way around caused
subsequent cases to be eliminated as dead
2020-10-30 15:58:13 +02:00
Vexu
e2e0b6272b
stage2: return same hash for different representations of same value 2020-10-30 15:58:13 +02:00
Vexu
3cc68bd913
stage2: switch liveness analysis 2020-10-30 15:58:13 +02:00
Vexu
769d5a9c43
stage2: switch comptime execution 2020-10-30 15:58:13 +02:00
Vexu
12e4c648cc
stage2: implement switch validation for integers 2020-10-30 15:58:13 +02:00
Vexu
4155d2ae24
stage2: switch ranges and multi item prongs 2020-10-30 15:58:13 +02:00
Vexu
3c96d79953
stage2: disallow switching on floats 2020-10-30 15:58:13 +02:00
Vexu
7db17a2d89
stage2: redesign switchbr
Switchbr now only  handles single item prongs.
Ranges and multi item prongs are checked with
condbrs after the switchbr.
2020-10-30 15:58:12 +02:00
Vexu
95467f3249
stage2: dump generated zir with --verbose-ir 2020-10-30 15:58:12 +02:00
Vexu
570f610341
stage2: fix test harness tmp path handling 2020-10-30 15:58:12 +02:00
Vexu
2020ca640e
stage2: switch emit zir 2020-10-30 15:58:12 +02:00
Vexu
11998d2972
stage2: basic switch analysis 2020-10-30 15:58:12 +02:00
Vexu
2c12f4a993
stage2: implement Value.eql for void, null and types 2020-10-30 15:58:12 +02:00
Vexu
7e2774367e
stage2: implement Value.hash 2020-10-30 15:58:12 +02:00
Vexu
27d233cef7
stage2: basic switch validation 2020-10-30 15:58:11 +02:00
Vexu
ad32e46bce
stage2: switch astgen 2020-10-30 15:58:11 +02:00
Vexu
a1d7f0053d
stage2: support imports inside packages 2020-10-30 15:58:11 +02:00
Vexu
8421b8a898
stage2: detect import outside file path 2020-10-30 15:58:11 +02:00
zhaozg
72343ffd06 fix #3237: resolve undefined symbol _DllMainCRTStartup 2020-10-29 20:09:22 -04:00
LemonBoy
490cafe2c5 stage1: Error out when trying to execute unreachable
Closes #6802
2020-10-29 20:06:52 -04:00
Andrew Kelley
f4bb8be9fc
Merge pull request #6654 from joachimschmidt557/stage2-arm
stage2 ARM: more stuff
2020-10-29 18:29:24 -04:00
Timon Kruiper
ad6e095ef6 stage2.Elf: fix off by one error in writeOffsetTableEntry
The code was using the length of the local symbols, which also
includes the null symbol. Fix this by using the offset table instead,
which only keeps track of the symbols that end up in the got.
2020-10-29 14:38:48 -04:00
LemonBoy
4fb896f16e
stage1: Fix bug in internal string slicing (#6843)
Closes #6456
2020-10-29 14:38:13 -04:00
Travis
3c7a49c494 add missing case for TokenizeStateSawDotStar at eof 2020-10-29 12:03:45 -05:00
Travis
069aee1495 don't allow a token starting with an asterisk directly following .* 2020-10-29 12:03:45 -05:00
LemonBoy
b3314a8be6 stage1: Fix small bug in pointer type analysis
A flag meant to catch recursively-defined types was never reset, leading
the compiler to generate wrong answers when asked for its
type/alignment.

Closes #6850
2020-10-29 15:41:45 +02:00
Veikka Tuominen
85dd5746bd
Merge pull request #6678 from s-ol/doc-type-aware
generated docs improvements: add vector, fntype, anytype type-printing; bool, function value-printing
2020-10-29 15:19:02 +02:00
LemonBoy
7bc9531698 stage1: Correctly generated optional constant values
Closes #6799
2020-10-28 21:56:28 +02:00
LemonBoy
6d2f103bfb stage1: Fix crash in comptime struct value copy
Comptime fields are never materialized in the ZigValue so pay attention
when iterating over the fields array.

Fixes #6800
2020-10-28 21:13:32 +02:00
Andrew Kelley
e1ca6946be rename ZigClangFloatingLiteral_getValueAsApproximateDouble 2020-10-27 14:16:43 -07:00
Andrew Kelley
e2caf57527 Merge branch 'frmdstryr-import-empty-file' 2020-10-26 16:07:46 -07:00
Andrew Kelley
435c8ad703 non-hacky workaround for the empty file bug
See #3328
2020-10-26 16:06:14 -07:00
Andrew Kelley
c1ae9f40c7 stage1: support "native" as the OS string in -target
This should help for bootstrapping purposes, intending to fix the macOS
CI.
2020-10-26 15:48:48 -07:00
frmdstryr
1ce0994897 Fix @import of empty file 2020-10-26 13:29:32 -07:00
mlarouche
e3fed3c814 Temp Fix for deadlock in C compilation, found and tested on Windows 2020-10-25 21:33:46 -04:00
joachimschmidt557
7b4f3c7cfc stage2 ARM: genSetStack and genSetReg from stack 2020-10-25 12:51:19 +01:00
joachimschmidt557
7d14426da4 stage2 ARM: enable backpatching return statement 2020-10-25 12:51:19 +01:00
joachimschmidt557
0e16328636 stage2 ARM: add multiply and multiply long instructions 2020-10-25 12:51:19 +01:00
joachimschmidt557
7391087df1 stage2 ARM: better immediate loading feat. movw and movt 2020-10-25 12:51:19 +01:00
Jakub Konka
872bc787b5 cc: fix regression on macOS after adding libc headers
Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-10-24 17:32:50 +02:00
s-ol
300b617140 generated docs: add FnFrame type support
See #3404
2020-10-23 15:44:32 +02:00
Timon Kruiper
4b48fccadd When checking a cache hit, make sure to handle a (re)moved source file
When a file cannot be found in the cache, it is not a hit.

Closes #6729
2020-10-23 01:01:37 -04:00
Andrew Kelley
e6ac082437
Merge pull request #6744 from LemonBoy/intcast-vec
stage1: Implement `@intCast` between vectors
2020-10-22 17:36:18 -04:00