Commit graph

22529 commits

Author SHA1 Message Date
leap123
ef8f694d77
std.os.uefi: fix shift in pool allocator (again) (#14497) 2023-01-31 13:08:30 -05:00
Jakub Konka
4404c4d200 link: make Elf atoms fully owned by the linker 2023-01-31 17:54:12 +01:00
Techatrix
47ff57ed7d wasm: apply request change 2023-01-31 17:01:56 +01:00
r00ster91
17404f8e6e Sema: emit compile error for comptime or inline call of function pointer 2023-01-31 17:15:34 +02:00
Andrew Kelley
d6b430b520 std.Target: remove workaround
This was working around a stage1 compiler bug.
2023-01-31 02:28:16 -05:00
Techatrix
1f64432196 wasm: correctly handle optional slices 2023-01-31 00:59:18 +01:00
Jakub Konka
d42a931051 link: make MachO atoms fully owned by the linker 2023-01-31 00:43:25 +01:00
Veikka Tuominen
f3bb1957fa update zig1.wasm to include @qualCast 2023-01-30 18:55:58 +02:00
Veikka Tuominen
f16c10a86b implement @qualCast 2023-01-30 18:55:57 +02:00
Veikka Tuominen
fe4ea31f7e Sema: replace backticks with single quotes
Most error messages already use single quotes for everything
so this makes the remaining ones consistent.
2023-01-30 15:20:16 +02:00
Veikka Tuominen
a9785fe8ee Sema: add helpful notes to invalid @ptrCast operations
Closes #14474
2023-01-30 15:20:16 +02:00
Veikka Tuominen
b129350cb5 AstGen: fix crash on invalid decltest
Closes  #14476
2023-01-30 15:20:16 +02:00
Veikka Tuominen
dd300d47b2 add test for already implemented proposal
Closes #1564
2023-01-30 15:20:16 +02:00
Veikka Tuominen
720d82721f Sema: ensure args to inline comptime args are comptime-known
Closes #14413
2023-01-30 15:20:16 +02:00
Techatrix
885d696895 zig fmt: fix file ending in a multi line comment 2023-01-30 00:42:05 +02:00
Jiacai Liu
d8c3c11c6c
std: add expectEqualDeep (#13995) 2023-01-29 22:00:14 +00:00
Veikka Tuominen
92dfc07489 TypedValue: fix crash when string-like aggregate has undefined element
Closes #6334
2023-01-29 23:16:45 +02:00
Isaac Freund
23b7d28896 std: restrict mem.span() and mem.len() to sentinel terminated pointers
These functions are currently footgunny when working with pointers to
arrays and slices. They just return the stated length of the array/slice
without iterating and looking for the first sentinel, even if the
array/slice is a sentinel terminated type.

From looking at the quite small list of places in the standard
library/compiler that this change breaks existing code, the new code
looks to be more readable in all cases.

The usage of std.mem.span/len was totally unneeded in most of the cases
affected by this breaking change.

We could remove these functions entirely in favor of other existing
functions in std.mem such as std.mem.sliceTo(), but that would be a
somewhat nasty breaking change as std.mem.span() is very widely used for
converting sentinel terminated pointers to slices. It is however not at
all widely used for anything else.

Therefore I think it is better to break these few non-standard and
potentially incorrect usages of these functions now and at some later
time, if deemed worthwhile, finally remove these functions.

If we wait for at least a full release cycle so that everyone adapts to
this change first, updating for the removal could be a simple find and
replace without needing to worry about the semantics.
2023-01-29 15:07:06 -05:00
kcbanner
7c2ba950a7 build: .c ofmt does not produce a pdb 2023-01-29 15:04:51 -05:00
kcbanner
a9b68308b9 cbe: fixes for tls, support for not linking libc, and enabling tests
- cbe: Implement linksection support, to support TLS when not linking libc
- cbe: Support under-aligned variables / struct fields
- cbe: Support packed structs (in the C definition of packed)
- windows: Fix regression with x86 _tls_array
- compiler_rt: Add 128-bit atomics to compiler_rt
- tests: Re-enable threadlocal tests on cbe+windows, and llvm+x86
- tests: Re-enable f80 tests that now pass
- ci: change windows ci to run the CBE behaviour tests with -lc, to match how the compiler is bootstrapped
- update zig1.wasm
2023-01-29 15:04:13 -05:00
Yusuf Bham
9177e0da4f std.os.uefi: fix shift in pool allocator 2023-01-29 15:02:22 -05:00
kcbanner
fcb05ee2e7 cbe: don't emit unused undefined array literals 2023-01-29 15:02:04 -05:00
Andrew Kelley
317d57115d std.debug: disable sporadically failing test
see tracking issue #13963
2023-01-29 12:48:38 -07:00
joachimschmidt557
090186a0c2 stage2 AArch64: move copy-register-arg-to-stack code to fn prologue
This enhances the debugging experience as upon encountering a
breakpoint in a function, all arguments passed as registers have
already been moved to the stack, ready to be inspected by the
debugger.
2023-01-29 20:00:53 +01:00
Krzysztof Wolicki Der Teufel
76fcb95bdf autodoc: Implemented struct_init_empty for walkInstruction, fixed variable type with has_init but no type before = 2023-01-29 14:42:18 +01:00
Michael Dusan
599b3ef9e9 netbsd: use versioned __msync13 from libc
The system linker shows warning when `msync` is linked instead of `__msync13`:

  "warning: reference to compatibility msync(); include <sys/mman.h> for correct reference"

closes #14422
2023-01-28 19:05:38 -05:00
zigster64
2b27bc2c65 On BrokenPipe error during os.sendfile - return error rather than unreachable 2023-01-28 18:27:43 -05:00
Jakub Konka
5a67ae506a
Merge pull request #14472 from ziglang/alloc-decls
self-hosted: remove allocateDeclIndexes from the linker API
2023-01-28 22:33:56 +01:00
Jon-Eric Cook
4c11684184
std.json: check output and source lengths in std.json 2023-01-28 16:26:36 +00:00
Andrew Kelley
f68d3c63df CI: give x86_64-linux-release a little more time
When the CPU cores are pegged, the thermal throttling kicks in and makes
jobs take significantly longer.
2023-01-27 14:53:17 -07:00
Jakub Konka
a898729139 self-hosted: remove allocateDeclIndexes from the public link.File API 2023-01-27 19:51:06 +01:00
Luuk de Gram
b25efb86e1
wasm: migrate to new non-allocateDeclIndexes API 2023-01-27 19:24:15 +01:00
Andrew Kelley
97b1a9bb6b cmake: no -Werror on the C++ code we copy from llvm 2023-01-26 20:13:27 -05:00
Takeshi Yoneda
ce20ebb50c wasi: remove unnecessary breakpoint() in abort
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2023-01-26 19:14:36 +01:00
Takeshi Yoneda
3c6c4f88bb wasm: uses main instead of main2 for test runner
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2023-01-26 17:49:43 +01:00
Jakub Konka
cc1d7a0e31 coff: migrate to new non-allocateDeclIndexes API 2023-01-26 14:29:14 +01:00
Jakub Konka
e1b9800ffa elf: migrate to new non-allocateDeclIndexes API 2023-01-26 14:29:14 +01:00
Jakub Konka
fb8d754a4b elf: move TextBlock into its own module and rename to Atom 2023-01-26 14:29:14 +01:00
Jakub Konka
2b5d0ca73b elf: pull out logic for allocating a GOT entry into a helper 2023-01-26 14:29:14 +01:00
Jakub Konka
041bc71bc8 self-hosted: clean up calling logic for x86_64 and aarch64 across linkers 2023-01-26 14:29:14 +01:00
Jakub Konka
4d804c1b23 macho: completely remove allocateDeclIndexes in favor of linker tracking 2023-01-26 14:29:14 +01:00
Jakub Konka
48f9e491cb
Merge pull request #14453 from ziglang/self-hosted-codegen-cleanup
self-hosted: cleanup codegen.Result
2023-01-26 08:01:51 +01:00
Andrew Kelley
96a55f6ce8
Merge pull request #14434 from FnControlOption/xz
Add xz decoder

closes #14300
closes #2851
2023-01-25 20:31:55 -05:00
Manlio Perillo
fcef728b9b langref: make "Type Coercion" subsections more consistent
In the "Type Coercion" section, rename:
  - Coercion Float to Int => Float to Int
  - unions and enums => Unions and Enums
  - tuples to arrays => Tuples to Arrays
2023-01-25 23:29:25 +02:00
Manlio Perillo
21d9f0c2a1 langref: add missing dot at the end of the paragraph
In the "C Variadic Functions" section, add a missing dot at the end of
the paragraph before the test_defining_variadic_function.zig example.
2023-01-25 16:09:17 -05:00
fn ⌃ ⌥
d0dedefde9 std.compress.xz: fix for big-endian targets 2023-01-25 08:49:59 -08:00
Manlio Perillo
d64dd75e34 langref: update the documentation of @Type
@Type is currently available for Functions.
2023-01-25 18:15:56 +02:00
Manlio Perillo
33e5a84706 langref: improve test_coerce_unions_enums.zig
Add more coercion examples to test_coerce_unions_enums.zig in the
"Type Coercion: unions and enums" section.
2023-01-25 17:03:39 +02:00
Manlio Perillo
8de46d1d7d langref: move paragraph inside the p element
In the "C Translation CLI" section, move the paragraph inside the p
element.

The current HTML is valid, but, as an example, a paragraph outside a p
element is not handled correctly by the browser Inspect tool.
2023-01-25 17:01:43 +02:00
Loris Cro
989e771534
Merge pull request #14456 from der-teufel-programming/autodoc-tuples
autodoc: added support for tuple structs
2023-01-25 15:44:08 +01:00