Andrew Kelley
4696cd3e09
fix ability to call methods on enums with pointer-to-self
...
closes #3218
2020-07-14 14:38:40 -07:00
Andrew Kelley
a92990f993
stage2: implement enough for assert() function to codegen
2020-07-14 02:24:12 -07:00
Andrew Kelley
c94652a2fd
stage2: add new test case
2020-07-13 00:31:55 -07:00
Andrew Kelley
08154c0deb
stage2: add retvoid support to CBE
2020-07-13 00:28:11 -07:00
Noam Preil
3bad1c16cc
Get basic return test working
2020-07-13 01:49:04 -04:00
Vexu
dff1ac1089
check for invalid sentinel when creating pointer with @Type
2020-07-13 00:29:53 +00:00
Vexu
e1a5e061ca
revert accidental format of tests
...
these test the tokenizers handling of EOF and formatting makes them useless
2020-07-12 11:27:50 +03:00
Vexu
bfe9d4184f
fix alignment parsing in stage1
2020-07-12 07:35:34 +00:00
Andrew Kelley
fe08a4d065
Merge pull request #5846 from Vexu/anytype
...
Rename 'var' type to 'anytype'
2020-07-12 07:35:01 +00:00
Vexu
be1507a7af
update compile error tests and some doc comments
2020-07-12 00:54:07 +03:00
Vexu
3e095d8ef3
use 'anytype' in translate-c
2020-07-11 22:04:38 +03:00
Vexu
e85fe13e44
run zig fmt on std lib and self hosted
2020-07-11 20:41:19 +03:00
Vexu
2e6688ae27
Add test for @typeInfo declarations showing up in declaration order
...
Both the stage1 and std lib HashMap implementations now preserve insertion order
2020-07-11 19:51:20 +03:00
Vexu
2e037fd827
use correct cast function when doing @floatCast at comptime
2020-07-11 11:36:28 +03:00
Andrew Kelley
02619edf41
Revert "use correct cast function when doing @floatCast at comptime"
...
This reverts commit 2e1bdd0d14f490a80bbed3ee0e0479a908715d33.
Test failures
2020-07-09 23:24:21 -07:00
Vexu
2e1bdd0d14
use correct cast function when doing @floatCast at comptime
...
Closes #5832
2020-07-09 21:25:55 +03:00
Andrew Kelley
0e1c7209e8
Merge pull request #5822 from pixelherodev/cbe
...
CBE cleanup
2020-07-09 03:32:34 +00:00
Noam Preil
6b48634166
CBE: Emit asm decls for now, but rename to make them valid
2020-07-08 14:05:07 -04:00
Andrew Kelley
6fbb5f0a81
Merge pull request #5816 from pixelherodev/cbe
...
Beginnings of C backend
2020-07-08 10:45:17 +00:00
Vexu
5667a21b1e
fix missing check on extern variables with no type
2020-07-08 03:09:41 +00:00
Noam Preil
b91cf15972
CBE: Move standards determination to generated code
2020-07-07 22:57:34 -04:00
Noam Preil
64bf130182
CBE: working asm Inputs and Outputs; std{int,def}.h auto-inclusion
2020-07-07 21:35:42 -04:00
Noam Preil
cf09b335d8
CBE: Working function call w/ no args or return value
2020-07-07 19:35:33 -04:00
Noam Preil
6ece36a051
Working translation of empty function
2020-07-07 17:51:59 -04:00
Noam Preil
a17200dab1
CBE skeleton
2020-07-07 16:40:14 -04:00
Noam Preil
b4c571301b
Stage2: Refactor in preparation for C backend
2020-07-07 14:55:44 -04:00
Andrew Kelley
abcd4ea5d8
Merge pull request #5793 from pfgithub/stage-2-testing
...
stage2 + operator and @as builtin
2020-07-05 22:58:05 +00:00
xackus
51f8c306d9
stage1: add missing runtime safety for @intCast unsigned -> signed of same bit count
2020-07-05 17:58:21 +02:00
pfg
4a63189bf1
stage2: add and @as tests
2020-07-04 15:30:17 -07:00
Ian Simonson
70cc1751ca
Translate-c fix rhs not cast on array access
...
Closes #5671 . Checks if the rhs is integral and of
differing or the same signedness. If they are different
does an @intCast to the lhs type
2020-07-02 14:05:12 +00:00
Andrew Kelley
8b82c40104
stage1: reimplement HashMap
...
The indexes are stored separately using an array of
uint8_t, uint16_t, uint32_t, or size_t, depending on the number of
entries in the map.
Entries only contain a key and a value, no longer have
distance_from_start_index or is_used.
In theory this should be both faster and use less memory.
In practice it seems to have little to no effect. For the standard
library tests, vs master branch, the time had no discernable
difference, and it shaved off only 13 MiB of peak rss usage.
2020-07-02 04:53:26 +00:00
Andrew Kelley
581d16154b
Merge pull request #5696 from alexnask/async_call_tuple
...
@asyncCall now takes arguments as a tuple instead of varargs
2020-06-28 01:00:58 -04:00
Andrew Kelley
ac6bf53069
stage2: clean up test harness, implement symbol collision detection ( #5708 )
...
* Clean up test harness
* Stage2/Testing: Add convenience wrappers
* Add a `compiles` wrapper case
* fix incremental compilation after error
* exported symbol collision detection
* function redefinition detection for Zig code
* handle missing function names
* Stage2/Testing: Simplify incremental compilation tests
* Stage2/Testing: Update documentation
* Stage2/TestHarness: Improve progress reporting
* Disable test
* Improve Tranform failure output
2020-06-27 21:54:11 -04:00
Noam Preil
97c41e7152
Disable test
2020-06-27 21:10:44 -04:00
Noam Preil
ab307a22f6
Stage2: remove clearErrors, fix ZIR export collision detection
2020-06-27 07:17:20 -04:00
Noam Preil
0e952a9f3a
Stage2/Testing: Simply incremental compilation tests
2020-06-26 05:00:53 -04:00
Noam Preil
c8f60b2e2f
Stage2: handle missing function names
2020-06-26 04:36:17 -04:00
Noam Preil
6510888039
Stage2: function redefinition detection for Zig code
2020-06-26 04:05:41 -04:00
Noam Preil
4a17e008da
Stage2: exported symbol collision detection
2020-06-26 03:17:13 -04:00
Noam Preil
649da2df52
Stage2/Testing: Add convenience wrappers
2020-06-26 02:42:02 -04:00
data-man
77bb2dc094
Use writer in benchmarks
2020-06-25 19:07:25 -04:00
arbrk1
78d8931647
Fix issue #5618 ( #5685 )
...
* fix issue #5618
* A test for the issue #5618 added.
Also inserted a comma in the neighboring test to make it more zigfmt-friendly.
2020-06-24 23:58:50 -04:00
Alexandros Naskos
2fde8249b7
Fixed crash when resolving peer types of *[N:s]const T and [*:s]const T
2020-06-24 23:58:02 -04:00
Noam Preil
c88edbc46f
OOM -> catch unreachable
2020-06-24 23:34:58 -04:00
Noam Preil
5d7e981f95
Clean up test harness
2020-06-24 22:43:18 -04:00
Andrew Kelley
20b4a2cf2c
self-hosted: add compare output test for new AST->ZIR code
2020-06-24 21:28:42 -04:00
Andrew Kelley
5aa3f56773
self-hosted: fix test regressions
...
I'm allowing incremental compilation of ZIR modules to be broken. This
is not a real use case of ZIR, and the feature requires a lot of code
duplication with incremental compilation of Zig AST (which works great).
2020-06-24 20:28:52 -04:00
Andrew Kelley
e42b7702eb
Merge remote-tracking branch 'origin/master' into zig-ast-to-zir
2020-06-24 15:36:59 -04:00
Alexandros Naskos
129a4fb251
Copy union const values correctly
2020-06-24 15:21:58 -04:00
Alexandros Naskos
7f342451b6
Fixed @asyncCall in runtime safety test
2020-06-24 18:43:11 +03:00