Commit Graph

8654 Commits (aaf99371b22e816a4162391d799b9d22bba21120)

Author SHA1 Message Date
Andrew Kelley aaf99371b2 look for clang-cpp shared lib when it exists
See #4799
2020-04-10 00:38:19 -04:00
Andrew Kelley 543031db35
Merge pull request #4982 from MageJohn/fix/binarySearch
sort.binarySearch: fix integer underflow (#4980)
2020-04-09 14:58:07 -04:00
joachimschmidt557 f1360bee1c Update docgen to new ArrayList API 2020-04-09 14:57:14 -04:00
Yuri Pieters f5f77089b7 sort.binarySearch: Remove unneeded edge case check 2020-04-09 09:13:47 +01: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
markfirmware c3afaa1f58 Update langref.html.in 2020-04-08 21:00:43 -04:00
Michael Dusan 57a2c5a63c ci: bump static-qemu 5.0.0-rc1 → 5.0.0-rc2 2020-04-08 21:00:17 -04:00
Yuri Pieters b7e72cc421 sort.binarySearch: test for regresson of #4980 2020-04-09 02:00:08 +01:00
Yuri Pieters 447dc2bb90 sort.binarySearch: fix integer underflow (#4980)
When the key was smaller than any value in the array, an error was
ocurring with the mid being zero and having 1 subtracted from it.
2020-04-09 01:58:57 +01: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
Andrew Kelley d5087ccbc8
cmake: expose ZIG_TARGET_MCPU option 2020-04-08 17:41:51 -04:00
Andrew Kelley 29ea425ca2
Merge branch 'LakeByTheWoods-translate_ptr_int'
closes #4688
2020-04-08 14:11:16 -04:00
Lachlan Easton d7902707bc
Translate C: Allow casting literal ints to pointers 2020-04-08 14:11:01 -04:00
Vexu 7b5fb79b5b
Translate C: Put an alignCast in c style pointer casts to allow opaque types to cast properly in C macros
Translate C: add test case for aligning opaque types in pointer casts
2020-04-08 14:11:01 -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
Phil Schumann b109186dd5
std/zig/parse_string_literal.zig: add hex+unicode escapes (#4678) 2020-04-07 20:27:18 -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 ed23dad487
fix the new runtime-safety tests
Thanks to Vexu's work in e62671f643, compile errors were identified in
these test cases! This commit fixes them to use `const` as appropriate.
2020-04-07 16:05:42 -04:00
Andrew Kelley 4d290758bb
fix compile errors in some std.Target functions
The `ve` architecture needed to be added to a couple switch statements.
2020-04-07 15:06:58 -04:00
xackus b7f116a774 langref: small updates 2020-04-07 14:54:53 -04: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 adaf7ad672
Merge pull request #4684 from LakeByTheWoods/comment_failed_decls
Translate C: Add comment containing c source location for failed decls
2020-04-07 21:47:32 +03:00
Andrew Kelley 87a7ea4c42
Merge pull request #4971 from Vexu/const-ref
Fix missing const on address of literal
2020-04-07 14:24:50 -04:00
joachimschmidt557 1ee59c5c31 move big.rational.gcd to big.int.gcd 2020-04-07 13:43:15 -04:00
Andrew Kelley a20f3e3f02
Merge pull request #4972 from mneumann/dragonfly-fix-compile
Fix compile on Dragonfly
2020-04-07 13:04:37 -04:00
Michael Neumann 2b9cef1e04 Add missing constants for DragonFly 2020-04-07 17:23:20 +02:00
Michael Neumann 7a829a7015 Fix paths to find llvm/clang on DragonFly 2020-04-07 17:13:33 +02:00
Vexu 95fefcd4c9
fix broken tests 2020-04-07 16:56:48 +03:00
Vexu e62671f643
fix missing const on address of literal 2020-04-07 15:25:44 +03:00
Andrew Kelley ab05766674
Merge pull request #4966 from ziglang/bootstrap-windows
cmake: improvements to cross-compiling for Windows
2020-04-06 23:16:31 -04:00
Andrew Kelley fc662ddd54
mingw-w64: add 32-bit version.def
fixes -lversion on 32-bit windows builds
2020-04-06 20:31:00 -04: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
Andrew Kelley 15ab61b2a0
cmake: improvements to cross-compiling for Windows
* don't unconditionally pass -lz3 for mingw builds. If mingw builds
   require this then the llvm-config executable should put it as part of
   --system-libs. If there is a bug and it does not do that, and we need
   a workaround, then the workaround should be an explicit cmake option.
 * don't link libstage2.a against -lntdll. This causes zig to set
   `builtin.link_mode == .Dynamic` and include the TLS definitions,
   which then collide with the mingw-w64 symbols. This should probably
   be addressed separately, but for now this solves the problem and
   there is no reason to link a static library against a DLL.
 * Findllvm.cmake no longer treats the libraries as "optional" and will
   emit a cmake error if one is not found. Additionally, the
   not-required LLVM library LLVMTableGen is omitted.
2020-04-06 18:38:09 -04:00
Andrew Kelley afa24ccd99 fix the build on Windows
Workaround for issue #2668

Zig std lib currently does not allow forward slashes in Windows path
names.
2020-04-06 18:35:49 -04:00
LemonBoy 0a936c1d76 Add some tests for the runtime safety checks 2020-04-06 20:14:06 +02:00
LemonBoy a59d31bd28 ir: Support tuple multiplication 2020-04-06 14:03:43 -04:00
Andrew Kelley e4eb817f79
libc_installation.zig: don't special-case based on C ABI
Whether the C ABI is mingw-w64 or msvc, detection of native libc paths
should be the same. In the future we may want to allow passing a C ABI
parameter to detectNativeCPaths() but for now we have the same behavior
regardless.
2020-04-06 13:33:32 -04:00
Andrew Kelley 96ed544665
build.zig supports specifying config.h location explicitly
also it does not try to run llvm-config executable when -Dlib-files-only

This fixes cross-compiling using the bootstrap repository.
2020-04-06 13:07:19 -04:00
LemonBoy a0b73c9f02 compiler-rt: Separate max size allowed for load/store and CAS
The v6m ISA has no way to express a CAS loop natively without turning
off the interrupts or using the kernel cmpxchg harness.

On such a platform the user has to provide a few __sync_* builtins to
satisfy the linker.
2020-04-06 12:52:53 -04:00
Vexu c5ced0d74a
Merge pull request #4939 from SuperAuguste/master
translate-c: Properly translate C multicharacter literals
2020-04-06 10:31:17 +03: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
SuperAuguste 6106cf4419 fixes 2020-04-05 19:06:43 -04:00
Benjamin Feng cb98984ae6 Generate clearer size mismatch error message 2020-04-05 18:38:19 -04:00
Andrew Kelley 05b587fcde
Merge branch 'LemonBoy-vec-div'
closes #4737
2020-04-05 18:34:47 -04:00