20990 Commits

Author SHA1 Message Date
Jakub Konka
28f525baa4 x86_64: handle ptr_stack_offset for blocks 2022-09-07 22:42:56 +02:00
Jakub Konka
1d57b347e9 x86_64: clean up logging 2022-09-07 22:42:56 +02:00
Jakub Konka
b9c31a8703 x86_64: refactor cond_br with canonicaliseBranches helper 2022-09-07 22:42:56 +02:00
Jakub Konka
c0e288c782 x86_64: implement canonicalising branches in switch expression 2022-09-07 22:42:56 +02:00
Jakub Konka
3a4c69c018 x86_64: implement Windows x64 calling convention 2022-09-07 22:42:56 +02:00
Jakub Konka
38573fed0b coff: fix runtime traps 2022-09-07 22:42:56 +02:00
Jakub Konka
49b1716064 coff: implement lowering unnamed consts 2022-09-07 22:42:56 +02:00
Jakub Konka
a19e6adbf9 x86_64: add support for Win64/C calling convention 2022-09-07 22:42:56 +02:00
Jakub Konka
aac4c1d3b2 coff: fix contents of IAT, and ensure codegen loads addr into reg
As far as I can see, unlike with MachO, we don't have any stubs
helper routines available and need to load a bound pointer into
a register to then call it.
2022-09-07 22:42:55 +02:00
Jakub Konka
0ebeb58d91 coff: populate import address table dir 2022-09-07 22:42:55 +02:00
Jakub Konka
1ab149c5fc coff: create import atoms and matching bindings 2022-09-07 22:42:55 +02:00
Jakub Konka
51fba37af7 coff: add relocation for call_extern 2022-09-07 22:42:55 +02:00
Jakub Konka
a35f156cf6 coff: re-enable default entrypoint for Windows 2022-09-07 22:42:55 +02:00
Jakub Konka
11d14a23a3 win-ci: add missing ZIGPREFIXPATH variable def 2022-09-07 22:21:12 +02:00
Luuk de Gram
a8d137d05a
wasm-linker: support incremental debug info
Although the wasm-linker previously already supported
debug information in incremental-mode, this was no longer
working as-is with the addition of supporting object-file-parsed
debug information. This commit implements the Zig-created debug information
structure from scratch which is a lot more robust and also allows
being linked with debug information from other object files.
2022-09-07 18:59:36 +02:00
Luuk de Gram
971327d6e0
wasm: fix memory leak 2022-09-07 18:53:16 +02:00
Luuk de Gram
f2c8d09c4f
wasm-linker: Mix Zig -and Object debug atoms
When linking a Zig-compilation with an object file,
we allow mixing the debug atoms to make sure debug
information is preserved from object files. By default,
we now always initialize all debug sections if the `strip` flag
is unset.

This also fixes relocations for debug information as previously
the offset of an atom wasn't calculated, and neither was the code
size itself which meant that debug lines were off and file names
from other object files were missing.
2022-09-07 18:53:16 +02:00
Luuk de Gram
b2718e213e
wasm-linker: use Atoms for zig debug info
Previously we used single arraylists for each debug section for debug
information that was generated from Zig code. (e.i. `Module` is available).
This information is now stored in Atoms, similarly to debug information
from object files. This will allow us to link them together and resolve
debug relocations.
2022-09-07 18:53:16 +02:00
Luuk de Gram
46c932a2c9
wasm-linker: perform debug relocations
This correctly performs a relocation for debug sections.
The result is that the wasm-linker can now correctly create
a binary from object files while preserving all debug information.
2022-09-07 18:53:16 +02:00
Luuk de Gram
c347751338
wasm-linker: write debug sections from objects
We now link relocatable debug sections with the correct
section symbol and then allocate and resolve the debug atoms
before writing them into the final binary.

Although this does perform the relocation, the actual relocations
are not done correctly yet.
2022-09-07 18:53:16 +02:00
Luuk de Gram
f060edb0f3
wasm-linker: create atoms from debug sections 2022-09-07 18:53:16 +02:00
Luuk de Gram
9a92f3d290
wasm/Object: parse debug sections into reloc data
Rather than storing the name of a debug section into the structure
`RelocatableData`, we use the `index` field as an offset into the
debug names table. This means we do not have to store an extra 16 bytes
for non-debug sections which can be massive for object files where each
data symbol has its own data section. The name of a debug section
can then be retrieved again when needed by using the offset and
then reading until the 0-delimiter.
2022-09-07 18:53:12 +02:00
Dan Ellis Echavarria
924679abc4
std.simd: change T to u16
The `element_bit_size` would break if `T` was signed due to `ceilPowerOfTwo` only working on unsigned numbers.
2022-09-07 15:22:30 +03:00
bfredl
e02b9f458d build-exe: allow combination of -fno-emit-bin and --verbose-air
Currently, `zig build-exe -fno-emit-bin --verbose-air src/main.zig`
results in no output at all. With this refactor, it dumps AIR
and then exits without invoking LLVM, as expected
2022-09-07 14:53:31 +03:00
Evan Haas
e283a40d17 translate-c: convert tabs to \t in object-like macro string literals
Closes #12549
2022-09-07 14:46:58 +03:00
Andrew Kelley
b7900de168 Merge remote-tracking branch 'origin/master' into llvm15 2022-09-06 19:45:02 -07:00
Loris Cro
e2bb92b2e2
Merge pull request #12736 from alichraghi/patch-2
autodoc: fix highlighted line in light mode
2022-09-05 17:37:12 +02:00
Loris Cro
201dca323e autodoc: improve rendering of long fn signatures 2022-09-05 17:26:59 +02:00
Loris Cro
3deb33fffa
Merge pull request #12738 from der-teufel-programming/autodoc-opaque-types
autodoc: Opaque now handled like other container types
2022-09-04 22:51:03 +02:00
Der Teufel
b8001335c4 autodoc: Opaque now handled like other container types 2022-09-04 22:47:58 +02:00
Loris Cro
dbd60e3d29 autodoc: add support for doc tests 2022-09-04 22:45:57 +02:00
Veikka Tuominen
9ce841a0f0 stage2 llvm: implement aarch64 C ABI
... at least enough to pass all the current tests.
2022-09-04 18:46:56 +03:00
Yujiri
ae3a5ff7f9 Fix #12440: std.math.big.Rational order/orderAbs 2022-09-04 18:45:20 +03:00
riChar
349cf54b32
llvm: fix the type parameter of GlobalAlias
Closes 12680
2022-09-04 18:44:45 +03:00
Ali Chraghi
5b3ca4bb53
autodoc: fix highlighted line in light mode 2022-09-04 14:13:47 +04:30
Veikka Tuominen
b7d5582ded
Merge pull request #12723 from Vexu/stage2-fixes
Stage2 fixes
2022-09-03 15:48:28 +03:00
Veikka Tuominen
c7884af063 translate-c: do not translate packed C structs as packed Zig structs in stage2
Zig's integer backed packed structs are not compatible with C's packed structs.
2022-09-03 03:42:42 +03:00
Veikka Tuominen
0f61d1f0df stage2 llvm: improve handling of i128 on Windows C ABI 2022-09-03 03:42:42 +03:00
Veikka Tuominen
b83c037f9f Sema: only ABI sized packed structs are extern compatible 2022-09-03 01:04:46 +03:00
yujiri8
10e11b60e5
zig fmt: don't delete container doc comments
Fixes #12617
2022-09-02 20:12:20 +02:00
Veikka Tuominen
6aee07c144 Sema: remove unused src param from typeRequiresComptime 2022-09-02 19:49:11 +03:00
Loris Cro
4a08c6dd51 autodoc: fix stage2 compile error 2022-09-02 18:13:17 +02:00
Loris Cro
e72a8ed5a1 autodoc: fix merge mistake 2022-09-02 17:59:37 +02:00
Loris Cro
907c60aaa7
Merge pull request #12705 from der-teufel-programming/autodoc-big-int
Autodoc big_int
2022-09-02 17:48:17 +02:00
Loris Cro
a77d7b740f autodoc: simplify int_big json stringify procedure 2022-09-02 17:47:04 +02:00
Loris Cro
70b96169ae
Merge pull request #12709 from der-teufel-programming/autodoc-compare-operators
autodoc: Compare operators
2022-09-02 17:38:00 +02:00
Loris Cro
0b11d8ec4d codeowners: mark myself as the codeowner of /src/autodoc/ 2022-09-02 17:35:41 +02:00
Loris Cro
081d5a9690 autodoc: correct line number implementation
we also correctly take advantage of the starting byte offset of the
parent decl when calling `tree.tokenLocation()`!
2022-09-02 17:28:12 +02:00
Veikka Tuominen
f281f3d10e Sema: improve behavior of comptime_int backed enums 2022-09-02 17:57:11 +03:00
Veikka Tuominen
a9cdacff95 Sema: add error for enum tag value overflow
Closes #12291
2022-09-02 17:57:11 +03:00