Veikka Tuominen
9d93b2ccf1
Eliminate BoundFn
type from the language
...
Closes #9484
2022-12-09 20:37:18 -07:00
Veikka Tuominen
5831b68341
AstGen: add check for missing builtin argument
...
Closes #13817
2022-12-09 20:37:18 -07:00
Veikka Tuominen
ee9fc54cd0
TypedValue: fix handling of tuples represented as empty_struct_value
2022-12-08 22:21:49 +02:00
Veikka Tuominen
653c0bae0c
remove stage1 specific compile error tests
2022-12-07 20:32:27 +02:00
Veikka Tuominen
dff32a2cd7
Sema: resolve lazy values in analyzeMinMax
...
Closes #13797
2022-12-07 14:48:24 +02:00
Andrew Kelley
1310ef7577
disable failing behavior tests with -ofmt=c -target x86_64-windows
...
and enable CI checks for the C backend on Windows.
2022-12-07 04:01:04 -05:00
Andrew Kelley
c8aba15c22
remove references to stage1 in behavior tests
...
Good riddance.
2022-12-06 19:06:48 -07:00
Andrew Kelley
b7b905d227
add behavior test for while(true) not needing else unreachable
...
closes #707
2022-12-06 17:57:27 -07:00
Andrew Kelley
57995c2100
translate-c: remove stage1 conditions from tests
2022-12-06 12:15:05 -07:00
Andrew Kelley
28514476ef
remove -fstage1
option
...
After this commit, the self-hosted compiler does not offer the option to
use stage1 as a backend anymore.
2022-12-06 12:15:04 -07:00
Andrew Kelley
518392d6fe
disable CBE behavior tests that are not passing in release modes
2022-12-04 15:57:40 -07:00
r00ster91
f094c4bce5
Sema: detect duplicate enum tag values
2022-12-04 14:12:24 +02:00
Jacob Young
e3b8658e65
cbe: add forward declarations for optionals and error unions
...
Arrays will have to wait for type rewrite.
2022-12-03 21:58:18 -05:00
Jacob Young
6d1292552e
cbe: implement function alignment
2022-12-03 08:40:08 -05:00
Jacob Young
ec3116f573
cbe: fix zero-bit struct field pointer
2022-12-03 08:40:08 -05:00
Jacob Young
7fb6eb3d14
cbe: implement multiple exports of a symbols
2022-12-03 08:21:03 -05:00
Jacob Young
81c271cc62
cbe: don't emit extern decls that are already exported
2022-12-03 08:21:03 -05:00
Andrew Kelley
610d604f5b
Merge pull request #13748 from jacobly0/c-unaligned
...
cbe: use memcpy for underaligned loads and stores
2022-12-03 02:18:07 -05:00
Andrew Kelley
fdbb0fb7b9
Merge pull request #13744 from Vexu/stage2-fixes
...
Improve error messages, fix dependency loops
2022-12-03 00:42:11 -05:00
Jacob Young
e1216077f0
cbe: add support for constraint modifiers specified after a colon
...
This translates `%[name:mod]` to `%mod[name]` for C.
2022-12-02 22:21:24 -05:00
Jacob Young
fdedd62365
cbe: use memcpy for underaligned loads and stores
2022-12-02 22:21:24 -05:00
Andrew Kelley
29e8e67a7e
CBE: use bool, true, false, instead of zig_
prefixes
...
In general the C backend should lower to human-maintainable C code
whenever possible. Directly using C types that one would use when
writing C code is one part of the strategy.
The concern with including stdint.h is C89 compatibility. Well, we can
just check the C std lib version before deciding to include that header.
2022-12-02 16:12:49 -07:00
Veikka Tuominen
b500e0eb17
Sema: add "parameter type declared here" note to type coercion
2022-12-03 00:48:04 +02:00
Veikka Tuominen
74285a4ed7
add test for error message improved by self-hosted
...
Closes #5099
2022-12-03 00:48:04 +02:00
Veikka Tuominen
f20e449fd6
Sema: improve error for mismatched type in implicit return
...
Closes #2653
2022-12-03 00:48:03 +02:00
Veikka Tuominen
e2509ddbe6
AstGen: add error for invalid string comparisons
...
These operations are allowed because the string literals are just
pointers but they produce unexpected results. These errors prevent
beginners from shooting themselves in the foot while still allowing
advanced users to circumvent them if they desire to do so.
Closes #8290
2022-12-03 00:09:23 +02:00
Veikka Tuominen
0e38cc16d5
Sema: fix comparisons between lazy and runtime values
...
Closes #12498
2022-12-03 00:09:23 +02:00
Veikka Tuominen
7f9e841f74
Sema: do not forcibly canonicalize unresolved pointer element type
...
Closes #13308
2022-12-03 00:09:23 +02:00
Veikka Tuominen
59dad43de2
Sema: add error for failed assumption about struct having runtime bits
2022-12-02 18:46:59 +02:00
Veikka Tuominen
86e6acb37b
AstGen: improve error message for missing parameter name
...
Closes #13393
2022-12-02 15:39:40 +02:00
Andrew Kelley
665eba93c1
CBE: eliminate zig_void
...
C void is perfectly fine.
2022-12-02 00:46:27 -05:00
Andrew Kelley
4071b22454
Merge pull request #13715 from Vexu/cbe
...
cbe bug fixes and improvements
2022-12-01 17:38:11 -05:00
Veikka Tuominen
6ded2d2adb
cbe: disable failing behavior test on aarch64
2022-12-01 12:18:10 +02:00
Veikka Tuominen
d0edaabf9d
Value: fix elemValueAdvanced for optional payloads
...
Closes #13707
2022-12-01 11:49:06 +02:00
Andrew Kelley
a943422672
Merge pull request #13717 from GethDW/option-fix
...
std.build.Builder: fix for Allocator changes
2022-11-30 19:43:51 -05:00
Andrew Kelley
b1793c2b52
add test coverage for zig build CLI and options API
2022-11-30 13:22:43 -07:00
Luuk de Gram
090deae41d
wasm: enable behavior tests for packed structs
2022-11-30 21:01:09 +01:00
Veikka Tuominen
11ec7109c3
cbe: do not memcpy identical integer types when bitcasting
2022-11-30 17:11:06 +02:00
Veikka Tuominen
15cc83e27a
cbe: reduce amount of temporary locals
2022-11-30 17:11:06 +02:00
Veikka Tuominen
f4afeb3ffd
AstGen: fix incorrect handling of source cursor with shift builtins
...
Closes #13714
2022-11-30 17:11:06 +02:00
Veikka Tuominen
2dcac348e5
cbe: implement packed unions
2022-11-30 15:14:33 +02:00
Veikka Tuominen
1a1a5702ab
cbe: correctly handle pointers to zero bit error union payloads
2022-11-30 15:14:33 +02:00
Veikka Tuominen
4def9c4a9b
cbe: operand of address of operator must be an lvalue
2022-11-30 15:14:33 +02:00
Veikka Tuominen
6310186d52
cbe: cast pointer switch target to int
2022-11-30 15:14:33 +02:00
Veikka Tuominen
8af5648015
Sema: make inferred allocs always mutable
...
Const allocs don't make any sense, make_ptr_const handles making
the pointers not mutable.
2022-11-30 15:14:33 +02:00
Veikka Tuominen
63ae7899ae
cbe: ensure test and tagName function names are unique
2022-11-30 15:14:33 +02:00
Andrew Kelley
ceb0a632cf
std.mem.Allocator: allow shrink to fail
...
closes #13535
2022-11-29 23:30:38 -07:00
Andrew Kelley
deda6b5146
LLVM: fix canElideLoad behavior with loops
...
closes #13546
2022-11-30 00:20:49 -05:00
Veikka Tuominen
b2b1d421c3
Sema: add missing failWithBadMemberAccess to zirExport
...
The assumption that AstGen would error only holds when exporting
a identifier not a namespace member.
2022-11-29 21:44:08 +02:00
Veikka Tuominen
4b0ef6a409
Sema: make non-existent field error point to field name
...
Closes #13698
2022-11-29 21:44:08 +02:00