4020 Commits

Author SHA1 Message Date
Vexu
29b3be4f2f
Merge pull request #5319 from Vexu/float-fix
Fix intToFloat on comptime_floats
2020-05-12 15:20:03 +03:00
Vexu
0847b47bf8
fix @intToFloat on comptime_floats 2020-05-12 00:24:09 +03:00
xackus
204f8daeed stage1: detect underflow in bigint_fits_in_bits 2020-05-11 14:06:37 +02: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
Tadeo Kondrak
7ada59f873
remove nakedcc/stdcallcc/async fn/extern fn fnproto 2020-05-05 09:37:28 -06: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
Vexu
adc444ceeb
fix missing compile error on call assigned to const 2020-05-04 14:28:58 +03:00
data-man
c8b4cc2ff9 Include dbg.h to third-party libs 2020-05-02 18:29:02 -04:00
Andrew Kelley
428065da30
Merge pull request #5243 from niacat/kern-arand
Avoid reading from /dev/urandom on NetBSD
2020-05-02 04:16:24 -04:00
Michael Dusan
09d6dc1ce6
stage1: cleanup
- remove unused IrInstSrcOptionalUnwrapPtr.initializing
2020-05-01 18:01:21 -04:00
nia
74ad315360 In init_rand avoid reading from /dev/urandom on NetBSD/FreeBSD
Use the KERN_ARND sysctl instead.
2020-05-01 17:23:27 +01:00
Tadeo Kondrak
249938dde0
Validate vector types for @Vector 2020-04-28 00:24:45 -06:00
Tadeo Kondrak
45f4a1124f implement @Type() for more types 2020-04-27 14:37:18 -04:00
George Roman
a17eb15e11 Add missing state to C object cache 2020-04-27 12:21:48 -04:00
Henry Nelson
83b0f9c6f7 Fix unfortunate typo 2020-04-26 17:33:04 -04:00
Andrew Kelley
6aeceec1f2 add CLI option -Bsymbolic for binding global references locally 2020-04-26 15:30:52 -04:00
George Roman
0c037a8561 Pass each target feature flag separately 2020-04-25 15:54:02 -04:00
LemonBoy
a7a8c433d0 stage1: Prevent the creation of illegal ptr types
Closes #5140
2020-04-24 15:55:32 -04:00
Timon Kruiper
c829f2f7b7 Add mips support to standard library 2020-04-24 15:28:55 -04:00
xackus
a9eb4a6740 stage1: fix crash on accessing an array of size zero with runtime index 2020-04-23 12:45:32 -04:00
LemonBoy
e6428f9401
stage1: Fix bitcast of immediate to ptr type (#5131)
Consider a (legal according to the `@bitCast` rules) conversion from u16
to [2]u8: since the former is a scalar and the latter is a pointer
(arrays are represented at pointers in the codegen phase) we have to
allocate a temporary slot on the stack and then bitcast the resulting
pointer to the desired destination type.

Beware that this means the lifetime of the resulting value is the same
of the function it's contained in and for all intents and purposes
should be regarded as a local (eg. it should not escape).

Closes #4395
Closes #5121
2020-04-23 12:44:16 -04:00
Andrew Kelley
e8545db9d4
Merge pull request #5130 from ziglang/stage2-ir
beginnings of non-LLVM self-hosted backend
2020-04-22 14:42:46 -04:00
LemonBoy
b5e72c0148 stage1: Prevent the creation of illegal pointer types
Changing the pointer length from Unknown to Single/C now resets the
sentinel value too.

Closes #5134
2020-04-22 14:40:57 -04:00
Andrew Kelley
173a143dd0
Merge pull request #5133 from LemonBoy/win-progress
Progressbar for Windows
2020-04-22 12:52:48 -04:00
LemonBoy
395b530387 stage1: Another hack for the C ABI compatibility
Applying the wrong ABI is slightly better than using the Zig ABI, the
whole thing is so wrong it should be burned to the ground.
2020-04-22 12:52:24 +02:00
Andrew Kelley
2cdbb5f472 ir: analyze int casting 2020-04-21 19:48:59 -04:00
elucent
48dc3b6fe9 Added peer type resolution for [*]T and *[N]T. 2020-04-21 18:09:03 -04:00
Michael Dusan
412aac8a70 cleanup: IrBasicBlockGen
remove unused param from `ir_ref_inst_gen`
2020-04-21 18:07:48 -04:00
Michael Dusan
73677e178d cleanup: IrBasicBlockGen
remove unused members { parent, index, ref_count }
2020-04-21 18:07:48 -04:00
LemonBoy
aca6b70184 stage1: Handle errors when generating block IR
Closes #5005
2020-04-20 22:39:34 -04:00
LemonBoy
5eaf948e62 stage1: Fix wrong union access
Thanks to @frett27 on irc for reporting the compiler would segfault when
run on ARM.
2020-04-20 13:43:14 -04:00
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