g-w1
ea18f894f5
Peer type resolution with unsigned ints and larger signed ints
2020-12-23 00:05:42 +02:00
Vexu
286077fec8
stage1: add missing error check on inferred struct field ptr
2020-12-21 12:40:51 +02:00
LemonBoy
84549b4267
stage1: Fix for generic fn monomorphization
...
Don't use the instantiation argument types to build the function
parameter array.
f416535768 worked around the problem, this
commit solves it.
2020-12-19 19:45:48 -05:00
Andrew Kelley
f291194834
Merge pull request #7362 from Vexu/std
...
zig fmt improvement and small miscellaneous fixes
2020-12-09 14:29:15 -05:00
Andrew Kelley
5ff0f364a5
Merge pull request #7366 from LemonBoy/fix-7346
...
Some compiler-rt fixes
2020-12-09 14:19:58 -05:00
LemonBoy
2f4f7ace7a
stage1: Resolve some constants to u32, not usize
...
The latter may be smaller than a u32, use a u32 explicitly.
2020-12-09 17:01:18 +01:00
Vexu
7e30e83900
small fixes and zig fmt
2020-12-09 13:54:26 +02:00
LemonBoy
8ac711596d
stage1: Validate the specified cc for lazy fn types
...
Closes #7337
2020-12-08 19:09:25 -05:00
LemonBoy
97f36d93f4
stage1: Don't fold single-element enums too aggressively
...
When the tag type is not a zero-sized type (eg. `enum(i32)`) we
absolutely need to avoid constant-folding this values. Doing so masked
any invalid input and, since the folding was not even applied
consistently, introduced some hard to catch errors.
2020-12-05 20:14:04 +01:00
Andrew Kelley
afaef36194
stage1: compile error for pointer arithmetic on ptr-to-array
...
See #2018
2020-12-03 17:07:13 -07:00
LemonBoy
df99cfdf1e
stage1: Fix typeInfo generation for arrays w/o sentinel
...
ZigTypeIdOptional types have a different way of specifying their payload
value depending on whether the child type is a pointer or not (plus some
other special cases).
Fixes #7251
2020-11-29 10:39:10 -08:00
Andrew Kelley
7dcda5b0e8
Merge pull request #7182 from LemonBoy/externnnn
...
Initial implementation of @extern builtin
2020-11-21 09:41:49 -08:00
LemonBoy
6029114f84
stage1: Resolve usingnamespace decls when calling @typeInfo
...
Closes #7176
2020-11-20 17:01:23 -08:00
LemonBoy
9b7d9c72b0
stage1: Initial implementation of @extern
2020-11-20 22:32:43 +01:00
Tadeo Kondrak
25ec2dbc1e
Add builtin.Signedness, use it instead of is_signed
2020-11-19 18:59:21 +02:00
pfg
cf7de64f1a
stage1: improve error for missing a number type on a runtime var
2020-11-18 21:45:51 +02:00
frmdstryr
a39d3155b4
Change error when runtime value passed to comptime arg
2020-11-18 13:33:45 +02:00
LemonBoy
129ccad434
stage1: Reject undefined values when taking union ptr
...
The code rightfully assumes the union_val object to be fully initialized.
Closes #7019
2020-11-18 13:21:36 +02:00
Vexu
08270d72b4
ensure TypeInfo payload is not undefined
2020-11-11 16:04:46 +02:00
LemonBoy
f0b1b74d21
stage1: Avoid resolving type entry in [0]T
...
The logic was already there but this rule was only applied in some
places, apply it in the remaining code paths.
Closes #7058
2020-11-11 13:53:24 +02:00
LemonBoy
be26c3bf4e
stage1: Fix *WithOverflow intrinsics with u0 values
...
Closes #5369
2020-11-02 13:40:00 -05:00
LemonBoy
0d6a7088dc
stage1: Implement Add/Mul reduction operators
2020-11-01 14:30:31 -07:00
LemonBoy
2957433b25
stage1: Fix comptime comparison of NaNs
2020-11-01 14:30:31 -07:00
LemonBoy
490cafe2c5
stage1: Error out when trying to execute unreachable
...
Closes #6802
2020-10-29 20:06:52 -04:00
LemonBoy
4fb896f16e
stage1: Fix bug in internal string slicing ( #6843 )
...
Closes #6456
2020-10-29 14:38:13 -04:00
LemonBoy
7bc9531698
stage1: Correctly generated optional constant values
...
Closes #6799
2020-10-28 21:56:28 +02: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
LemonBoy
2f465761bb
stage1: Implement @intCast between vectors
...
Explicit and implicit integer casts on vector types are now supported
and follow the same rules as their scalar counterparts.
Implicit float casts are accidentally supported, `@floatCast` is still
not vector-aware.
2020-10-19 20:05:09 +02:00
LemonBoy
2a256d5ea0
stage1: Fix type-checking of unary neg for vector types
...
Validate the vector element type as done for the scalar case.
Fixes #6708
2020-10-17 21:08:39 -04:00
vegecode
0456b2145d
byteOffsetOf rounds up using bit offset in host integer
2020-10-16 20:04:42 -07:00
LemonBoy
2a62d4b20b
stage1: Expand undefined struct/arrays when indexed
...
Fixes #6693
2020-10-16 17:13:38 +03:00
Andrew Kelley
8b7539bd95
Merge remote-tracking branch 'origin/master' into llvm11
...
Conflicts:
src/clang.zig
Master branch renamed an enum; this branch gave it an explicit tag type
and explicitly initialized values. This commit combines the changes
together.
2020-10-08 15:47:45 -07:00
Tadeo Kondrak
0e57f220fb
stage1: Disallow arrays in function parameters or return types
...
Closes #6535 .
2020-10-08 04:17:32 -04:00
Andrew Kelley
95a37373e9
Merge pull request #6421 from tadeokondrak/opaque-syntax
...
Add opaque syntax that allows declarations
2020-10-07 16:58:50 -04:00
Tadeo Kondrak
0a6863a267
Remove .Cold calling convention.
...
This isn't a stable, defined calling convention, so it shouldn't be
grouped in with the others.
Closes https://github.com/ziglang/zig/issues/6556
2020-10-07 04:31:20 -04:00
pfg
ae161863db
stage1: improve error messages for missing try statements
2020-10-07 03:50:11 -04:00
Andrew Kelley
b5a36f676b
Merge remote-tracking branch 'origin/master' into llvm11
...
Conflicts:
cmake/Findllvm.cmake
The llvm11 branch changed 10's to 11's and master branch added the
"using LLVM_CONFIG_EXE" help message, so the resolution was to merge
these changes together.
I also added a check to make sure LLVM is built with AVR enabled, which
is no longer an experimental target.
2020-10-07 00:46:05 -07:00
Tadeo Kondrak
bf4bfe54ac
Update compile error test for field access of opaque type
2020-10-06 22:08:30 -06:00
Tadeo Kondrak
069fbb3c01
Add opaque type syntax
2020-10-06 22:08:24 -06:00
Andrew Kelley
939b4860ef
Merge pull request #6472 from alexnask/add_some_frees
...
Add a few missing deallocations of temporaries to stage1
2020-10-05 04:56:58 -04:00
LemonBoy
22b5e47839
stage1: Implement @reduce builtin for vector types
...
The builtin folds a Vector(N,T) into a scalar T using a specified
operator.
Closes #2698
2020-10-05 04:51:45 -04:00
Alexandros Naskos
23cd3b3331
Merge branch 'master' of https://github.com/ziglang/zig into add_some_frees
2020-10-04 10:39:26 +03:00
Tadeo Kondrak
183d1d4ba1
Switch TypeInfo.Fn.alignment to comptime_int from u29
...
All integers in TypeInfo are intentionally comptime_int:
https://github.com/ziglang/zig/issues/1683
2020-10-01 18:01:41 -06:00
Tadeo Kondrak
e18fdc12b0
stage1: Implement @Type for Fn and BoundFn
2020-10-01 18:01:38 -06:00
Tadeo Kondrak
97ab720d84
stage1: Add alignment to TypeInfo.Fn
2020-10-01 17:59:42 -06:00
Tadeo Kondrak
a12203d2be
Switch TypeInfo alignment fields from u29 to comptime_int
2020-10-01 15:01:28 -06:00
Tadeo Kondrak
d81648ce8c
Add alignment field to TypeInfo.UnionField and TypeInfo.StructField
...
Closes https://github.com/ziglang/zig/issues/6122
2020-10-01 15:01:25 -06:00
Tadeo Kondrak
77df5dae7f
Make builtin.TypeInfo.Pointer.alignment u29 instead of comptime_int
2020-10-01 15:01:24 -06:00
Alexandros Naskos
82f0ede3ad
Added some c_allocator.deallocate calls
2020-09-30 19:59:49 +03:00
Alexandros Naskos
cb5d290f33
Added a few ZigList deinit calls
2020-09-30 17:09:18 +03:00