20090 Commits

Author SHA1 Message Date
Jakub Konka
99c2cb72e8 coff: track globals in contiguous array to allow for tombstones 2022-09-07 22:42:59 +02:00
Jakub Konka
f3e4e44a2b coff: fix memory leak in incorrectly disposing of globals table 2022-09-07 22:42:58 +02:00
Jakub Konka
945111ae92 enable testing of x86_64-windows-gnu using self-hosted backend and linker 2022-09-07 22:42:58 +02:00
Jakub Konka
7b8cc599d9 coff: use more generous initial memory sizes for sections 2022-09-07 22:42:58 +02:00
Jakub Konka
16ca47b9b8 coff: remove redundant bits and clean up 2022-09-07 22:42:58 +02:00
Jakub Konka
2b373b0579 coff: grow section in virtual address space when required 2022-09-07 22:42:58 +02:00
Jakub Konka
9116e0f746 coff: find new file space for a section (file offsets) 2022-09-07 22:42:58 +02:00
Jakub Konka
79e51c5e4b coff: differentiate between file space and VM space for alloc 2022-09-07 22:42:58 +02:00
Jakub Konka
08f6546c84 coff: create a helper for allocating sections 2022-09-07 22:42:58 +02:00
Jakub Konka
f1bdf3f62f coff: fix writing strtab to PE image file 2022-09-07 22:42:57 +02:00
Jakub Konka
467d69c68a x86_64: fix SystemV calling convention 2022-09-07 22:42:57 +02:00
Jakub Konka
56a131d27a test-cases: fix compiler error locations for hello world with updates 2022-09-07 22:42:57 +02:00
Jakub Konka
66bad3eaaf coff: mark relocations dirty when target atoms change 2022-09-07 22:42:57 +02:00
Jakub Konka
1e2a2d6fad coff: fix bug in lowerUnnamedConst 2022-09-07 22:42:57 +02:00
Jakub Konka
423f424c27 libstd: use windows.GetStdHandle() with stage2_x86_64 backend for now 2022-09-07 22:42:57 +02:00
Jakub Konka
e0167ae0e3 x86_64: allow for any index register in complex SIB encodings
This relieves register pressure, and reduce generated code size
(since now we can use the same index register for both `mov_scale_src`
and `mov_scale_dst` MIR instructions).

Fix lowering of ModRM + SIB encodings where index register is extended
- previously, we would carelessly ignore the fact generating incorrect
encodings.
2022-09-07 22:42:57 +02:00
Jakub Konka
619d82234e x86_64: clean up return registers for unspecified cc 2022-09-07 22:42:57 +02:00
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
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
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