Vexu
fd2f034e31
fix comptime comparisons of different sized floats
2020-07-21 22:29:15 +03:00
Vexu
596ca6cf70
allow non-pointer extern opaque variables
2020-07-18 16:45:07 +03:00
Vexu
78962eeeda
fix floatCast type check regression
...
Closes #5900
2020-07-18 10:22:15 +03:00
Vexu
a1e78d0b06
add is_tuple field to struct typeinfo
...
part of #4335
2020-07-17 00:15:34 +03:00
Andrew Kelley
a7c3cec65f
follow up from previous commit for generic methods
2020-07-14 15:29:07 -07:00
Andrew Kelley
4696cd3e09
fix ability to call methods on enums with pointer-to-self
...
closes #3218
2020-07-14 14:38:40 -07:00
Vexu
dff1ac1089
check for invalid sentinel when creating pointer with @Type
2020-07-13 00:29:53 +00:00
Vexu
8110639c79
add 'anytype' to stage1 and langref
2020-07-11 17:41:33 +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
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
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
Alexandros Naskos
eefcd04462
Small fixes, fixed tests, added test for argument tuple type
2020-06-24 16:56:24 +03:00
Alexandros Naskos
50b70bd77f
@asyncCall now requires an argument tuple
2020-06-24 14:07:39 +03:00
antlilja
0de35af98b
Add duplicate checking for switch on types
...
* Add compile error tests
2020-06-23 15:17:04 -04:00
xackus
d907f574e0
stage1: fix concat of sliced str literals
2020-06-21 14:57:12 -04:00
Robin Voetter
8696e52a3d
Make unary minus for unsigned types a compile error ( #5654 )
...
* Make unary minus for unsigned types a compile error
* Add unreachable when generating unsigned negate
2020-06-21 14:55:44 -04:00
Andrew Kelley
c70633eacd
Merge pull request #5203 from tadeokondrak/@type-for-even-more-types
...
implement @typeInfo for Frame and implement @Type for Frame, EnumLiteral, and ErrorSet
2020-06-18 21:25:03 -04:00
Andrew Kelley
5ea0f589c9
Merge pull request #5625 from antlilja/master
...
Improve support for f128 and comptime_float operations
2020-06-18 20:32:43 -04:00
Andrew Kelley
4a38799631
make file and fn_name fields of SourceLocation also null-terminated
...
One of the main motivating use cases for this language feature is
tracing/profiling tools, which expect null-terminated strings for these
values. Since the data is statically allocated, making them
additionally null-terminated comes at no cost.
This prevents the requirement of compile-time code to convert to
null-termination, which could increase the compilation time of
code with tracing enabled.
See #2029
2020-06-18 17:09:10 -04:00
Vexu
a5379aa3ee
implement @src
2020-06-18 21:11:09 +03:00
antlilja
1157ee1307
Improve builtin op support for f128/comptime_float
...
* Add support for fabs, floor, ceil, trunc and round
* Add behavior tests
2020-06-17 17:35:45 +02:00
Jakub Konka
04c3fae720
Remove obsolete branch in ir_analyze_cast
...
Branch handling `*[N]T` to `E![]T` is already handled in a more complete
branch handling `*[N]T` to `[]T` *and* `*[N]T` to `E![]T` so it seems
safe to remove this one.
2020-06-16 18:24:45 -04:00
Andrew Kelley
2bb3e1aff4
stage1: implement type coercion of anon struct literal to struct
...
closes #3672
2020-06-15 16:52:18 -04:00
Jakub Konka
52b97eeef1
Return u32 in @wasmMemorySize instead of i32
2020-06-09 00:22:34 -04:00
Jakub Konka
057d97c093
Return should be i32 due to error signaling in memory.grow
...
Also, fix tests.
2020-06-09 00:22:34 -04:00
Jakub Konka
3f0a3cea6e
Fix builtins to return and accept u32 instead of i32
2020-06-09 00:22:34 -04:00
Jakub Konka
8ffa8ed9a8
Expose full llvm intrinsic
2020-06-09 00:22:34 -04:00
Jakub Konka
601e831f1d
Add builtin for llvm.wasm.memory.grow.i32 intrinsic
...
This will allow the developer to request additional memory pages
from the runtime to be allocated for the Wasm app. Typical usage:
```zig
var wasm_pages = @wasmMemorySize();
@wasmMemoryGrow(1);
@import("std").debug.assert((wasm_pages + 1) == @wasmMemorySize());
```
2020-06-09 00:22:17 -04:00
Jakub Konka
ce3f0077cf
Add builtin for llvm.wasm.memory.size.i32 instrinsic
...
This will allow the developer to poll the runtime for currently
allocated memory in the number of Wasm pages. Typical usage:
```zig
var wasm_pages = @wasmMemorySize();
@import("std").debug.assert(wasm_pages > 0);
```
2020-06-09 00:22:17 -04:00
Andrew Kelley
9ee98f103b
Merge pull request #5539 from mikdusan/issue5474
...
stage1: fix constness in some corner cases
2020-06-09 00:12:57 -04:00
xackus
0d40cb6255
stage1: fix crash on slice byte reinterpretation
2020-06-08 17:19:06 -04:00
Michael Dusan
c0c9d11d8c
stage1: fix constness in some corner cases
...
- for one-possible-value types, ir_analyze_struct_field_ptr()
no longer hardcodes const/volatile
- when slicing arrays, ir_analyze_instruction_slice()
no longer consults ConstValSpecialStatic
closes #5474
2020-06-05 00:49:57 -04:00
xackus
250dd9ac21
stage1: fix unresolved inferred error sets
2020-05-31 15:04:34 +02:00
foobles
51682717d7
Support equality comparison for optional to non-optional (?T ==/!= T)
...
extracted function ir_try_evaluate_bin_op_const
extracted type_is_self_comparable function
renamed ir_try_evaluate_bin_op_const to ir_try_evaluate_bin_op_cmp_const
implemented analysis of ?T == T
added ir_set_cursor_at_end_and_append_basic_block_gen
use build_br_gen and ir_set_cursor_at_end_and_append_block_gen
added ir_append_basic_block_gen
removed include of all_types in ir.cpp
extracted compile-time and runtime evaluation of cmp_optional_non_optional to separate functions
closes #5390
closes #1332
2020-05-29 18:46:09 -04:00
Veikka Tuominen
4c8b937fb0
Merge pull request #5184 from alexnask/typeof_extern_call
...
Extern functions are now evaluated to undefined values at comptime in TypeOf calls.
2020-05-30 01:11:22 +03:00
foobles
cb6bc5bdb5
Add caller location tracking for asserts (ir_assert, src_assert, ir_assert_gen) ( #5393 )
2020-05-26 12:55:31 -04:00
Andrew Kelley
c432811d96
fix regression in compile errors
2020-05-23 20:27:09 -04:00
Andrew Kelley
140dc2f43e
stage1: fix false positive redeclared variable compile error
2020-05-20 23:13:02 -04:00
Alexandros Naskos
400a91e1c6
Add TypeOf resolution of dereferences and struct fields of undefined values
2020-05-18 19:15:44 +03:00
Andrew Kelley
9a22c8b6ca
Merge pull request #5057 from xackus/opaque-param
...
stage1: fix assert fail on opaque fn ptr param
2020-05-17 12:48:56 -04:00
Vexu
0847b47bf8
fix @intToFloat on comptime_floats
2020-05-12 00:24:09 +03:00
Vexu
f2d3266075
Merge pull request #4932 from Qix-/fix-private-access
...
Fix private access
2020-05-08 18:21:15 +03:00
Josh Junon
4a5c58dd35
fix private member checking for non-canonical invocations ( fixes #4909 )
2020-05-08 14:26:13 +03:00
xackus
2c9effc101
stage1: handle all cases of invalid struct field default value
2020-05-07 16:39:16 -04:00
Andrew Kelley
e6955688ac
Merge pull request #5272 from tadeokondrak/noasync-to-nosuspend
...
Noasync to nosuspend
2020-05-05 11:21:02 -04:00
Tadeo Kondrak
b957dc29a4
Rename noasync to nosuspend in C++ compiler
2020-05-05 05:17:34 -06:00
Vexu
f127dee474
Merge pull request #5267 from Vexu/const-call
...
Fix missing compile error on call assigned to const
2020-05-04 21:45:15 +03:00