LemonBoy
328eb8ed8d
stage1: Fix signed multiplication overflow
...
Spotted thanks to UBSan
2020-04-19 06:46:33 -04:00
Andrew Kelley
051620dcaf
Merge pull request #5097 from Vexu/field
...
Disallow declarations between fields
2020-04-19 03:52:53 -04:00
xackus
d415ffd7d9
fix uninitialized ZigValue
2020-04-19 03:49:36 -04:00
Vexu
fff00c3bbb
disallow declarations between container fields
2020-04-18 23:56:03 +03:00
Vexu
4f02cf32b4
fix typeInfo tests
2020-04-18 11:39:52 +03:00
Vexu
1afaf42525
add error for non-exter variadic functions
2020-04-17 22:02:49 +03:00
Vexu
c026a9f6d2
fix missing compile errors on builtin cast functions
2020-04-17 14:22:20 -04:00
LemonBoy
8e96922f31
stage1: Fix several bugs in constant generation
...
The codegen would sometimes change the LLVM type for some constants to
an unnamed structure in order to accomodate extra padding. This is fine
as long as the alignment of each field is still respected and it was not
the case for structure types, leading to ill-formed constants being
generated.
Optional types suffer from this to a lower extent as their layout is
quite lucky, the only missing piece was the tail padding.
Closes #4530
Closes #4594
Closes #4295
Closes my will to live
2020-04-17 13:42:23 -04:00
Layne Gustafson
480deacbab
CC: fix binary dupe with no -o
2020-04-15 12:52:35 -04:00
foobles
022a71ca7d
Shift error message now says "fixed-width integer type" instead of just "integer type" ( #5028 )
...
* error message of ir_analyze_bit_shift now more accurate/specific
* fixed compile error test to match bit shift error message
2020-04-14 16:19:45 -04:00
Andrew Kelley
fc48c232e5
cli: add c++ subcommand to --help menu
...
closes #5034
2020-04-14 13:38:18 -04:00
LemonBoy
ce21a784a4
stage1: More fixes for BE targets
...
* Fix packed struct alignment
* Adjust some tests
2020-04-13 17:35:14 -04:00
Michael Dusan
20b2457388
only use -nostdinc++ on c++ files
...
This is a follow-up to d27ef1aaef8ac12801ba4e6c2ed748c7151096a7
and avoids compiler warnings:
warning: argument unused during compilation: '-nostdinc++'
2020-04-12 01:03:27 -04:00
Andrew Kelley
d27ef1aaef
Zig treats -lstdc++ identically to -lc++
...
Thanks to Michael Dusan for figuring out what was happening here.
closes #5012
2020-04-12 00:50:16 -04:00
Andrew Kelley
a6e288d5fe
Merge pull request #4711 from leroycep/feature-file-locks
...
Add lock option to File.OpenFlags and File.CreateFlags
2020-04-10 15:00:45 -04:00
Timon Kruiper
121307679b
Fix generated docs of user code
...
fff3c1fff4c3ebfcb2bd4f08a43ae7815b5c446b broke the docs generation for
own user code. This adds a workaround, because all the code in docs/main.js
is relying on the fact that the root package of the main package is the
root package itself.
2020-04-10 14:59:51 -04:00
Vexu
f60e7348d5
add error message for invalid assignment
2020-04-09 11:50:32 +03:00
Andrew Kelley
beae932e0f
Merge pull request #4975 from Vexu/param-reassign
...
Fix missing compile error on assign to slice and array parameters
2020-04-08 21:02:50 -04:00
Andrew Kelley
c45ba49b8b
fix formatted printing warning
...
needed to use ZIG_PRI_u64 instead of %lu
2020-04-08 19:30:18 -04:00
Vexu
b1e44adcba
move array and struct const checks to more appropriate places
2020-04-08 14:32:02 +03:00
Andrew Kelley
b3aef49eea
zig provides shlwapi.lib for *-windows-gnu
...
closes #3711
2020-04-08 01:21:00 -04:00
xackus
66b2477ab6
fix lazy value in ir_analyze_instruction_elem_ptr
2020-04-07 18:22:17 -04:00
Vexu
ff0f97a1bc
fix missing compile error on assign to slice and array parameters
2020-04-08 00:27:14 +03:00
Andrew Kelley
22dbeab29d
Merge pull request #4857 from LemonBoy/fix-4777
...
Rewrite the bound checks in slice operator
2020-04-07 14:51:25 -04:00
LemonBoy
cc0fca9d83
stage1: Respect the specified name for extern var
...
Extend the logic used for function definitions to variables.
Closes #4947
2020-04-07 14:48:37 -04:00
Vexu
e62671f643
fix missing const on address of literal
2020-04-07 15:25:44 +03:00
LeRoyce Pearson
798207ec80
Merge branch 'master' into feature-file-locks
2020-04-06 21:51:57 -06:00
Andrew Kelley
41cb49eb58
stage1 fixes to support building with 32-bit mingw-w64
2020-04-06 20:30:34 -04:00
Andrew Kelley
9ed00b3829
provide ___mb_cur_max_func for i386-windows-gnu
2020-04-06 19:26:31 -04:00
Andrew Kelley
64d0960244
zig cc: recognize a few more linker options
...
* `--major-image-version`
* `--minor-image-version`
* `--stack`
2020-04-06 19:13:36 -04:00
LemonBoy
a59d31bd28
ir: Support tuple multiplication
2020-04-06 14:03:43 -04:00
Andrew Kelley
701c03d083
zig uses mingw-w64 to provide -lpsapi
2020-04-05 23:06:47 -04:00
Andrew Kelley
28d9696617
use mingw-w64 to provide -luuid if requested
2020-04-05 23:06:47 -04:00
LemonBoy
f6cdc94a50
ir: Fix error checking for vector ops
...
The extra logic that's needed was lost during a refactoring, now it
should be fine.
2020-04-05 18:34:31 -04:00
LemonBoy
fe77c38247
ir: Remove unused and commented out code
2020-04-05 18:34:31 -04:00
LemonBoy
d2d97e55cc
ir: Support shift left/right on vectors
2020-04-05 18:34:31 -04:00
LemonBoy
2485f30046
ir: Support bitwise not on vectors
2020-04-05 18:34:31 -04:00
LemonBoy
54ffcf95a8
ir: Support div/mod/rem on vector types
...
Closes #4050
2020-04-05 18:34:31 -04:00
Andrew Kelley
e2dc63644a
type_has_one_possible_value takes comptime struct fields into account
...
Before, type_has_one_possible_value would return false for the value
`.{1}`. But actually, that type is a tuple with a single comptime field.
Such a type, in fact, has one possible value.
This plus the corresponding adjustment to get_the_one_possible_value
solves #3878 .
2020-04-05 17:09:01 -04:00
Michaël Larouche
c4a5f519f2
Do not parse native_libc.txt anymore when linking on native target, always run detection of libc.
...
Fixes #4772
2020-04-05 11:01:35 -04:00
Andrew Kelley
e5d479b06e
detect an endless loop when trying to detect native libc installation
...
closes #4810
2020-04-04 15:03:22 -04:00
Andrew Kelley
52db13738b
zig cc looks for native include directories unless -nostdinc
...
closes #4938
2020-04-04 14:58:24 -04:00
Andrew Kelley
d02838b71a
add libutil to zig's glibc support
2020-04-04 14:43:51 -04:00
Andrew Kelley
cf8728aabd
Merge pull request #4935 from LemonBoy/stage1-eb
...
Big-endian fixes for stage1
2020-04-04 13:45:49 -04:00
Andrew Kelley
d73808f3ff
remove zig BUILD_INFO hack
...
Rather than stuffing configuration information into the Zig binary, the
build script reads it from config.h. This solves a problem for package
maintainers and improves the use case of deterministic builds.
closes #3758
2020-04-04 11:57:28 -04:00
LemonBoy
ad2ebc87f2
stage1: Byteswap floats when serializing them
2020-04-04 16:55:24 +02:00
LemonBoy
084c62f5d1
stage1: Fix serialization of ZigValue on BE machines
2020-04-04 14:06:32 +02:00
Michael Dusan
db4c06ce60
stage1: add compile errors for sentinel slicing
...
closes #3963
2020-04-03 19:05:30 -04:00
Andrew Kelley
cf52f3f99a
zig cc: add -allow-shlib-undefined alias
2020-04-03 13:45:16 -04:00
Andrew Kelley
11b50e3ad8
change the default ABI of riscv64-linux-musl
...
Before, this would cause a link failure when mixing Zig and C code for
RISC-V targets.
Now, the ABIs match and Zig and C code can be mixed successfully.
I will file a follow-up issue for the ability to deal more explicitly
with ABIs.
closes #4863
2020-04-03 13:13:09 -04:00