Commit Graph

19881 Commits

Author SHA1 Message Date
Loris Cro
c8d04fea15
Merge pull request #12598 from ziglang/autodoc-anonstruct-wip
Autodoc: anon_init_struct support
2022-08-23 18:50:36 +02:00
Loris Cro
b32e5a14ce autodoc: handle self-referential call+field_type instructions 2022-08-23 18:45:22 +02:00
Loris Cro
0482e8ba9d autodoc: initial support for struct_init_anon 2022-08-23 18:37:29 +02:00
Loris Cro
583175dc1d ci: upload rendered source listings in stdlib docs 2022-08-23 15:59:35 +02:00
Loris Cro
102a6e9e9c
Merge pull request #12481 from alichraghi/patch-1
docs: add padding between functions list
2022-08-23 15:48:35 +02:00
Loris Cro
13e502b89b
Merge pull request #12502 from squeek502/autodoc-fields-light-mode
autodoc: Fix border color around field docs in light mode
2022-08-23 15:48:01 +02:00
Loris Cro
d635dcacbf
Merge pull request #12542 from der-teufel-programming/compileError-input
autodoc: show compileErrors correctly
2022-08-23 15:46:26 +02:00
Loris Cro
8c27e7ed91
Merge pull request #12583 from der-teufel-programming/autodoc-error-set
autodoc: error sets now display all their members
2022-08-23 15:44:13 +02:00
Andrew Kelley
1ce71c86bf std.debug: implement support for DWARFv5 2022-08-23 00:28:45 -07:00
Jakub Konka
c84e5ee878 coff: improve default COFF/PE object parser
We now do not allocate memory for headers and other metadata unless
requested by the caller. Instead, we read-in the entire contents
of the image into memory and operate on pointers and casts wherever
possible. I have a left a TODO to hook up Windows' memory-mapped API
here in-place of standard `readToEndAlloc` which should be more memory
proof on memory constrained hosts.

This commit also supplements our `std.coff` with a lot missing basic
extern structs required to make our COFF linker.
2022-08-23 08:55:04 +02:00
Der Teufel
970268d1f5 autodoc: error sets now display all their members 2022-08-23 08:35:13 +02:00
Andrew Kelley
9043e665a5 add behavior test for copying array of vectors
closes #12026
2022-08-22 18:37:42 -07:00
Ryan Liptak
95c43e20b4 Windows: Fix incorrect output when .pdb file is not found during stack trace
This `pdb.Pdb.init` call can return `error.FileNotFound`, which was previously resulting in:

    Unable to print stack trace: FileNotFound

which also aborts the stack trace printing (so any deeper stack traces are not printed).

It makes more sense to treat it as `MissingDebugInfo` which then gets printed as:

    ???:?:?: 0x7fffa8817033 in ??? (???)

and allows the stack trace to continue printing.

Note: locally, the error.FileNotFound was being triggered for me when looking for kernel32.pdb and ntdll.pdb
2022-08-22 20:51:55 -04:00
Keith Chambers
96737ef499
Dwarf: Added stroffsetsptr support (#12270)
* Added support for stroffsetsptr class in Dwarf stdlib

* Proper initializion of debug_str_offsets in DwarfInfo

* Added missing null initializer to DwarfInfo in Macho

* Added missing is_64 field to getAttrString in DwarfInfo

* Fixed formatting

* Added missing is_64 param to getAttrString

* Added required cast to usize

* Adding missing .debug_str_offsets initialization

* getAttrString now uses the str_offsets_base attr
2022-08-22 20:50:06 -04:00
Andrew Kelley
6d679eb2bc LLVM: update to DWARF version 5
clang-14 uses DWARF 5 as the default. Let's join them.
2022-08-22 16:57:18 -07:00
Andrew Kelley
5d2e9a1244 test harness: don't skip tests
The meaning of this "skip_stage2" flag was intended to mean the
self-hosted backends, not the stage2 frontend. Sorry for the confusion.

closes #12541
2022-08-22 19:50:32 -04:00
Andrew Kelley
dae7aeb337 llvm: add valgrind client request integration for x86_64
closes #12500
2022-08-22 16:04:07 -07:00
Andrew Kelley
ecdd4a9fe8 build system: add flag for -fstack-protector 2022-08-22 15:11:34 -07:00
Andrew Kelley
c955379504 Revert "test_runner: workaround #1923, isolating error traces in tests"
This reverts commit 1a32f2a7f4.

Sorry, this workaround is not welcome. Instead, please solve the actual
issue by doing the accepted behavior in the compiler itself:

> in a catch or else (handling a returned error), if the block does not
> try or return error.xyz, set the index to 0

This also applies to if statements, such as the one that test runner is
doing just above this hack.
2022-08-22 11:46:54 -07:00
Techcable
1a32f2a7f4
test_runner: workaround #1923, isolating error traces in tests
Essentially #1923 means "caught" errors still show up in error return traces.
The correct fix would require the compiler to fix this, but that could affect performance.

For now, simply workaround this issue by clearing the return traces
between tests.

This means that "caught" errors in one test will not show up in the
error traces of other tests.
2022-08-22 14:38:03 +03:00
Veikka Tuominen
8667d6d61e
Merge pull request #12563 from Vexu/stage2-fixes
Stage2 fixes
2022-08-22 14:32:31 +03:00
Veikka Tuominen
5404dcdfd8 Sema: fix fieldCallBind on tuples and anon structs
Closes #12573
2022-08-22 14:31:58 +03:00
InKryption
f1999712b0 std.io.Reader: bounded array functions
* Add readIntoBoundedBytes
 * Add readBoundedBytes
2022-08-22 14:07:22 +03:00
Shane Kennedy
cd5a9ba1f4
lagnref: add signed integer repr documentation
Closes #11103
2022-08-22 13:57:51 +03:00
Justas Zabulionis
24d718e7eb
std.valgrind.callgrind: fix string type
Fixes the error when using std.vallgrind.callgrind:
error: expected type '[2]u8', found '*const [2:0]u8'
2022-08-22 13:55:00 +03:00
Veikka Tuominen
560baf67ce Sema: fix implicit cast from extern fn to fn ptr
Closes #12570
2022-08-22 11:16:36 +03:00
Veikka Tuominen
b0bcd4add2 Sema: allow optional pointers in packed structs
Closes #12572
2022-08-22 11:16:36 +03:00
Veikka Tuominen
74c7782c60 Sema: make orelse with C pointers behave like stage1 for now
Closes #12537
2022-08-22 11:16:36 +03:00
Veikka Tuominen
c1afe57d70 Sema: resolve lazy values in resolveMaybeUndefValIntable
Closes #12512
Closes #12513
2022-08-22 11:16:36 +03:00
Veikka Tuominen
b55a5007fa Sema: fix parameter of type 'T' must be comptime error
Closes #12519
Closes #12505
2022-08-22 11:16:36 +03:00
Veikka Tuominen
b2f02a820f Sema: check for astgen failures in semaStructFields
The struct might be a top level struct in which case it might not have Zir.

Closes #12548
2022-08-22 11:16:36 +03:00
Jakub Konka
6c020cdb76
Merge pull request #12557 from Luukdegram/wasm-archive
wasm-linker: Improve archive linking
2022-08-22 08:38:41 +02:00
John Schmidt
9cf667a21b Enable unexpectedErrno error tracing for stage2 LLVM
Stage2 seems to be able to handle this now.
2022-08-21 23:41:01 +03:00
Luuk de Gram
d4c56804df
std: fix EmulatableRunStep
Fixes a compilation error when using the `EmulatableRunStep`
that is being generated from a step directly using `runEmulatable`.
2022-08-21 16:42:11 +02:00
Veikka Tuominen
02070ae26b
Merge pull request #12499 from Vexu/explain-why-called-at-comptime
stage2: add note about function call being comptime because of comptime only return type
2022-08-21 17:27:52 +03:00
Veikka Tuominen
20d0018d79 Sema: ignore dbg_block instructions when checking for comptimeness
Closes #12514
2022-08-21 12:53:19 +03:00
Veikka Tuominen
d48af541c7 Sema: handle union and enum field order being different
Closes #12543
2022-08-21 12:51:40 +03:00
Veikka Tuominen
e8102d8738 Sema: add note about function call being comptime because of comptime only return type 2022-08-21 12:24:48 +03:00
Der Teufel
76c9ee9b30 autodoc: Fixed compileError case in exprName 2022-08-21 06:32:26 +02:00
Der Teufel
a022157956 autodoc: compileError now uses index into exprs instead of a []const u8 2022-08-21 05:29:39 +02:00
Jakub Konka
4a98385b0a macho: do not leave file descriptors open if unused
This manifested in different `AccessDenied` errors on Windows when
trying to do an atomic file copying in the compiler/linker.
2022-08-20 19:41:23 +02:00
Luuk de Gram
7fe2a3d104
test/link: add wasm linker-test for archives
Adds a test case that will pull-in compiler-rt symbols,
and therefore link with the compiler-rt archive file.
2022-08-20 15:46:39 +02:00
Luuk de Gram
1544625df3
wasm/Object: parse using the correct file size
When an object file is being parsed from within an archive
file, we provide the object file size to ensure we do not
read past the object file. This is because follow up object
files can exist there, as well as an LF character to notate
the end of the file was reached. Such a character is invalid
within the object file.

This also fixes a bug in getting the function/global type
for defined globals/functions from object files as it was missing
the substraction with the import count of the respective type.
2022-08-20 14:50:11 +02:00
Luuk de Gram
aca911ca18
wasm/archive: correctly parse long file names
Wasm archive files are encoded the same way as GNU.
This means that the header notates the character index within
the long file name list rather than the length of the name.
The entire name is then delimited by an LF character (0x0a).

This also makes a cosmetic update to remove the `self` name,
and rather label it as `archive` instead.
2022-08-20 14:50:08 +02:00
Ryan Liptak
9740bb2423 autodoc: Fix border color around field docs in light mode
Follow up to https://github.com/ziglang/zig/pull/12305
2022-08-19 19:06:01 -07:00
Andrew Kelley
e5e6eb9831
Merge pull request #12368 from ziglang/stage3-default
make self-hosted the default compiler
2022-08-19 20:26:46 -04:00
Andrew Kelley
b75eeae595 CI: x86_64-linux: avoid cmake ZIG_EXECUTABLE hack
empirically this avoids a segfault on the CI.
2022-08-19 17:24:23 -07:00
Andrew Kelley
e78e9f33c0 CI: update x86_64-linux tarball 2022-08-19 16:45:16 -07:00
Andrew Kelley
3ce8060818 CI: update windows tarball 2022-08-19 16:45:16 -07:00
Andrew Kelley
4a27d2aac6 std.os.linux.bpf: fix compile error 2022-08-19 16:45:16 -07:00