Commit Graph

14105 Commits

Author SHA1 Message Date
Jakub Konka 32386a06ca builtin: enable panic handler on self-hosted macho
comp: toggle compiler-rt and zig-libc caps for macho
2024-02-08 23:51:21 +01:00
Jakub Konka 5da9d250ff macho: fix incorrect skip conditions for zig and dwarf sections 2024-02-08 22:08:51 +01:00
Jakub Konka dcb7f5791a macho: alloc improvement for relocatable 2024-02-08 13:22:48 +01:00
Jakub Konka 102846315c macho: couple small fixes 2024-02-08 13:12:06 +01:00
Jakub Konka ce207caa24 macho: in relocatable mode, macho emit __DWARF directly 2024-02-08 12:15:46 +01:00
Jakub Konka 37033a96ac macho: move Dwarf handle to ZigObject from DebugSymbols 2024-02-08 11:13:52 +01:00
Andrew Kelley 3122fd0ba0 Merge pull request #17634 from ianprime0509/type-erased-writer
Add type-erased writer and GenericWriter
2024-02-07 23:52:53 -08:00
Jakub Konka 272fc2df2e macho: use preadAll to read in object files when emitting archive 2024-02-07 23:25:15 +01:00
Jakub Konka 114518c6b0 macho: fix 32bit builds 2024-02-07 21:28:20 +01:00
Jakub Konka e3b6d347b2 macho: remove fallback to llvm-ar 2024-02-07 19:27:26 +01:00
Jakub Konka f9eb14ddcf macho: parse input object files specifically for incl in archive 2024-02-07 19:27:26 +01:00
Jakub Konka 82144a9073 macho: fix invalid ZigObject size calculation 2024-02-07 19:27:26 +01:00
Jakub Konka 35ac066f1d macho: fix writing SYMDEF symtab size 2024-02-07 19:27:26 +01:00
Jakub Konka efa1c6124d macho: emit an archive 2024-02-07 19:27:26 +01:00
Jakub Konka 897a554109 macho: populate output archive symtab 2024-02-07 19:27:26 +01:00
Jakub Konka 80cafad9d3 macho: read-in committed ZigObject to memory from file 2024-02-07 19:27:26 +01:00
Jakub Konka 7f01b61679 macho: move static lib emitting logic to relocatable.zig 2024-02-07 19:27:25 +01:00
Jakub Konka bdbb1dbe15 macho: refactor markExports, markImportsExports and claimUnresolved 2024-02-07 19:27:25 +01:00
Jakub Konka 352e27c55c macho: move static lib flushing logic into Archive 2024-02-07 19:27:25 +01:00
Jacob Young b3aed4e2c8 link: report function failures in FuncAnalysis
This unblocks backend errors after #18814.
2024-02-07 07:12:32 +00:00
Jacob Young 9211938e6e Elf: fix memory leaks 2024-02-07 00:17:23 -05:00
Jacob Young 38c2a25735 Builder: fix memory leaks 2024-02-06 22:31:13 -05:00
Manlio Perillo 3da6043e2c compiler: remove unnecessary pub declarations in main.zig
Some declarations, like zig subcommands and usage strings, are
unnecessary marked as public, even thought they are only referenced by
main.zig.
2024-02-06 16:09:55 -08:00
Pyry Kovanen 476ba04753 x86: remove final vestiges of mir_to_air (#18836) 2024-02-06 14:13:31 -05:00
David Rubin 24fb6d1f30 Make @intFromEnum an error for empty enums 2024-02-06 21:04:09 +02:00
Jakub Konka db6addf31a macho: store open file descriptors in a global array 2024-02-06 17:38:50 +01:00
David Rubin 3069669bc1 add the clflush mnem 2024-02-06 07:08:16 -05:00
Matthew Lugg 0c80725068 Merge pull request #18814 from mlugg/incremental-dependencies
Begin re-implementing incremental compilation
2024-02-06 11:33:07 +00:00
Andrew Kelley dd54804d86 compiler: make Value's self reference non pub
Done in this separate commit to make rebasing on this branch work
better.
2024-02-05 18:14:19 -07:00
Andrew Kelley 78f15bc714 compiler: rename value.zig to Value.zig
This commit only does the file rename to be friendlier to version
control conflicts.
2024-02-05 18:13:07 -07:00
Andrew Kelley 2de5e31721 compiler: flatten Value struct
This commit is almost entirely whitespace.
2024-02-05 18:07:56 -07:00
Ali Chraghi 739108c9f0 spirv: support enum integer values in Assembler 2024-02-05 11:55:14 +03:30
Ali Chraghi b41aad0193 spirv: emit vectors whenever we can 2024-02-05 11:55:14 +03:30
Ali Chraghi afa7793351 spirv: basic shader support 2024-02-05 11:55:14 +03:30
Robin Voetter 7634a115c5 Merge pull request #18580 from Snektron/spirv-more-vectors
spirv: more vector operations
2024-02-05 09:24:49 +01:00
Jacob Young 941d3a2bb1 x86_64: fix miscompilations on baseline 2024-02-05 02:16:56 -05:00
Jacob Young eaa6218f09 x86_64: fix errors compiling the compiler
This fixes issues targetting both `x86_64-linux` and `x86_64-macos` with
the self-hosted backend.
2024-02-04 22:58:38 -05:00
Jakub Konka f5dbcd1cb4 macho: add <cpu_arch>-macosx to target strings as a fallback target
Turns out that around 10.13/10.14 macOS release version, Apple changed the target tags in
tbd files from `macosx` to `macos`. In order to be compliant and therefore actually support
linking on older platforms against `libSystem.tbd`, we add `<cpu_arch>-macosx` to target strings.
2024-02-05 00:09:26 +01:00
mlugg 0784d38984 compiler: lock incremental dependency tracking behind --debug-incremental
This logic (currently) has a non-trivial cost (particularly in terms of
peak RSS) for tracking dependencies. Until incremental compilation is in
use in the wild, it doesn't make sense for users to pay that cost.
2024-02-04 19:17:20 +00:00
mlugg 0d8207c292 Zcu: refactor Decl.analysis field
* Functions failing codegen now set this failure on the function
  analysis state. Decl analysis `codegen_failure` is reserved for
  failures generating constant values.

* `liveness_failure` is consolidated into `codegen_failure`, as we do
  not need to distinguish these, and Liveness.Verify is just a debugging
  feature anyway.

* `sema_failure_retryable` and `codegen_failure_retryable` are removed.
  Instead, retryable failures are recorded in the new
  `Zcu.retryable_failures` list. On an incremental update, this list is
  flushed, and all elements are marked as outdated so that we re-attempt
  analysis and code generation.

Also remove the `generation` fields from `Zcu` and `Decl` as these are
not needed by our new strategy for incremental updates.
2024-02-04 18:38:40 +00:00
mlugg 269c1ae649 Zcu: incremental compilation improvements
* Mark root Decls for re-analysis separately
* Check for re-analysis of root Decls
* Remove `outdated` entry when analyzing fn body
* Remove legacy `outdated` field from Decl analysis state
2024-02-04 18:38:40 +00:00
mlugg a0004cebc2 Zcu: more dependency tracking logic
* Invalidate `decl_val` dependencies
* Recursively mark and un-mark all dependencies correctly
* Queue analysis of outdated dependers in `Compilation.performAllTheWork`

Introduces logic to invalidate `decl_val` dependencies after
`Zcu.semaDecl` completes. Also, recursively un-mark dependencies as PO
where needed.

With this, all dependency invalidation logic is in place. The next step
is analyzing outdated dependencies and triggering appropriate
re-analysis.
2024-02-04 18:38:39 +00:00
mlugg 1e91ee1e05 Zir: store extra source hashes required for incremental
Also add corresponding invaidation logic to Zcu. Therefore, the only
invalidation logic which is not yet in place is `decl_val` dependencies.
2024-02-04 18:38:39 +00:00
mlugg 7f4bd247c7 compiler: re-introduce dependencies for incremental compilation
Sema now tracks dependencies appropriately. Early logic in Zcu for
resolving outdated decls/functions is in place. The setup used does not
support `usingnamespace`; compilations using this construct are not yet
supported by this incremental compilation model.
2024-02-04 18:38:39 +00:00
Robin Voetter 2511106150 spirv: air vector_store_element 2024-02-04 19:09:34 +01:00
Robin Voetter 1d548aa2aa spirv: air splat 2024-02-04 19:09:33 +01:00
Robin Voetter 76d5696434 spirv: air abs 2024-02-04 19:09:32 +01:00
Robin Voetter 631d1b63a8 spirv: fix shuffle properly 2024-02-04 19:09:32 +01:00
Robin Voetter 9641d2ebdb spirv: vectorize max, min 2024-02-04 19:09:31 +01:00
Robin Voetter 9f0227a326 spirv: vectorize int_cast, trunc 2024-02-04 19:09:31 +01:00