1425 Commits

Author SHA1 Message Date
Jakub Konka
9735953ae2 wasm: implement moving debug_line program when header too big 2022-12-09 09:24:25 +01:00
Jakub Konka
742aa94280 dsym: hint linker when file range copy is not necessary 2022-12-09 09:24:25 +01:00
Jakub Konka
9ade4f6d8c elf: hint linker when file range copy is not necessary 2022-12-09 09:24:25 +01:00
Jakub Konka
d7e42014ca elf: add growAllocSection and growNonAllocSection
Update `Dwarf.zig` to use `growNonAllocSection` for ELF and implement
routine to make space for `.debug_line` header.
2022-12-09 09:24:25 +01:00
Jakub Konka
aa2f48f013 dsym: reuse growSection where possible 2022-12-09 09:24:25 +01:00
Jakub Konka
fa44c73c1e dwarf: move any remaining section growth to dsym 2022-12-09 09:24:25 +01:00
Jakub Konka
b14e580ad8 dwarf: move growing debug_aranges section to dsym 2022-12-09 09:24:25 +01:00
Jakub Konka
136a508027 dsym: finish markDirty helper 2022-12-09 09:24:25 +01:00
Jakub Konka
ecb341a006 dwarf: move growing debug_abbrev section to dsym 2022-12-09 09:24:25 +01:00
Jakub Konka
381abcfb7a dwarf: move another sect growing routine to d_sym 2022-12-09 09:24:25 +01:00
Jakub Konka
4bb66b63ba macho: add helper for getting ptr to DebugSymbols 2022-12-09 09:24:25 +01:00
Jakub Konka
05e221796a dwarf+d_sym: move logic for growing section to d_sym 2022-12-09 09:24:25 +01:00
Jakub Konka
4c38ba7d1b dwarf: move SrcFns if debug_line header exceeded its padding 2022-12-09 09:24:25 +01:00
Jakub Konka
be2b85f670 dwarf: refactor object file format and ptr width switches in writeDbgLineHeader 2022-12-09 09:24:25 +01:00
Jakub Konka
8e71a79e4b dwarf: fix incorrect calc of dir index 2022-12-09 09:24:25 +01:00
Jakub Konka
62145a1b08 dwarf: refactor routine for precalculating size of dbg line header 2022-12-09 09:24:25 +01:00
Jakub Konka
6817219e27 dwarf: generate list of include dirs and file names like LLVM backend 2022-12-09 09:24:25 +01:00
Jakub Konka
6ec34edb9a dwarf: fully resolve each path to each file source 2022-12-09 09:24:25 +01:00
Jakub Konka
f5c764d892 dwarf: track source files via *const Module.File pointers 2022-12-09 09:24:25 +01:00
Jakub Konka
4c4821d993 dwarf: specify all referenced zig source files 2022-12-09 09:24:25 +01:00
Andrew Kelley
28514476ef remove -fstage1 option
After this commit, the self-hosted compiler does not offer the option to
use stage1 as a backend anymore.
2022-12-06 12:15:04 -07:00
Jakub Konka
12e34e7037 dwarf: pull out debug line program internals into DeclState helpers 2022-12-05 22:35:07 +01:00
Jakub Konka
8796da0283 dwarf: reuse getDbgInfoAtom helper in all of Dwarf.zig
We need to access it outside of `DeclState` too so why not reuse
the helper anyway.
2022-12-05 14:19:22 +01:00
Jakub Konka
3575048c0a
Merge pull request #13763 from ziglang/macho-dsym-incr
macho+dsym: refactor and reorganize file layout to support incremental DWARF updates
2022-12-05 13:48:12 +01:00
Andrew Kelley
db1819e8ed CBE: fix use-after-free of Type keys in free_locals map 2022-12-04 15:57:40 -07:00
Andrew Kelley
8d8b2c834d CBE: exploit Liveness analysis to reuse locals 2022-12-04 15:57:40 -07:00
Jakub Konka
899d7a771e dsym: dummy repush to check the linux CI 2022-12-04 18:15:14 +01:00
Jakub Konka
a84b67468c dsym: recalculate DWARF segment size when finalizing 2022-12-04 16:58:45 +01:00
Jakub Konka
280dad0283 dsym+dwarf: remove copyRangeAllOverlappingAlloc 2022-12-04 16:58:45 +01:00
Jakub Konka
aa8b26cf25 dsym: refactor API - do not store ptr to MachO 2022-12-04 16:58:45 +01:00
Jakub Konka
d67de87baa dsym: add helper for accessing dwarf seg pointer 2022-12-04 16:58:45 +01:00
Jakub Konka
73d76b26a2 dsym: rename updateLinkeditSegment to finalizeDwarfSegment
This is the checkpoint where we finalize the VM of the primary binary.
2022-12-04 16:58:45 +01:00
Jakub Konka
278426b851 dsym: make sure DWARF segment comes before LINKEDIT
This will greatly simplify incremental updates to DWARF sections
within the bundle.
2022-12-04 16:58:45 +01:00
Jacob Young
81c271cc62 cbe: don't emit extern decls that are already exported 2022-12-03 08:21:03 -05:00
Andrew Kelley
fdbb0fb7b9
Merge pull request #13744 from Vexu/stage2-fixes
Improve error messages, fix dependency loops
2022-12-03 00:42:11 -05:00
Veikka Tuominen
0e38cc16d5 Sema: fix comparisons between lazy and runtime values
Closes #12498
2022-12-03 00:09:23 +02:00
Jakub Konka
bfd36cbf97 dwarf: pass linker Tag and owner Decl.Index instead of *Atom 2022-12-02 13:17:52 +01:00
Jakub Konka
3ec0520bac dwarf: use common DI union object for arg and var gen 2022-12-02 12:22:17 +01:00
Jakub Konka
8fea84f77e dwarf: move Wasm specific dwarf gen out of codegen 2022-12-01 20:55:55 +01:00
Jakub Konka
4120332577 dwarf: fix typos after refactoring dbi gen 2022-12-01 17:23:28 +01:00
Jakub Konka
5bffc17c42 codegen: make LinkerLoad a common struct shared by backends 2022-12-01 16:32:09 +01:00
Jakub Konka
00016ab6a0 dwarf: extract common logic for generating func var dbg info 2022-12-01 15:28:22 +01:00
Jakub Konka
5ee99f862a dwarf: extract common logic for generating func arg dbg info 2022-12-01 14:06:24 +01:00
Luuk de Gram
090deae41d
wasm: enable behavior tests for packed structs 2022-11-30 21:01:09 +01:00
Luuk de Gram
3933a4bac5
codegen: support generating packed structs 2022-11-30 17:56:02 +01:00
Andrew Kelley
ceb0a632cf std.mem.Allocator: allow shrink to fail
closes #13535
2022-11-29 23:30:38 -07:00
Robin Voetter
074ba69ba6
spirv: assembler
spirv: introduce SpvModule.Fn to generate function code into

spirv: assembler error message setup

spirv: runtime spec info

spirv: inline assembly tokenizer

spirv: inline assembly lhs result/opcode parsing

spirv: forgot to fmt

spirv: tokenize opcodes and assigned result-ids

spirv: operand parsing setup

spirv: assembler string literals

spirv: assembler integer literals

spirv: assembler value enums

spirv: assembler bit masks

spirv: update assembler to new asm air format

spirv: target 1.5 for now

Current vulkan sdk version (1.3.204) ships spirv tools targetting 1.5,
and so these do not work with binaries targetting 1.6 yet. In the
future, this version number should be decided by the target.

spirv: store operands in flat arraylist.

Instead of having dedicated Operand variants for variadic operands,
just flatten them and store them in the normal inst.operands list.
This is a little simpler, but is not easily decodable in the operand
data representation.

spirv: parse variadic assembly operands

spirv: improve assembler result-id tokenization

spirv: begin instruction processing

spirv: only remove decl if it was actually allocated

spirv: work around weird miscompilation

Seems like there are problems with switch in anonymous struct literals.

spirv: begin resolving some types in assembler

spirv: improve instruction processing

spirv: rename some types + process OpTypeInt

spirv: process OpTypeVector

spirv: process OpTypeMatrix and OpTypeSampler

spirv: add opcode class to spec, remove @exclude'd instructions

spirv: process more type instructions

spirv: OpTypeFunction

spirv: OpTypeOpaque

spirv: parse LiteralContextDependentNumber operands

spirv: emit assembly instruction into right section

spirv: parse OpPhi parameters

spirv: inline assembly inputs

spirv: also copy air types

spirv: inline assembly outputs

spirv: spir-v address spaces

spirv: basic vector constants/types and shuffle

spirv: assembler OpTypeImage

spirv: some stuff

spirv: remove spirv address spaces for now
2022-11-23 19:17:58 +01:00
David Gonzalez Martin
79bba5a9e6 uefi: Delete unneeded alignment and use default 4K
Closes #7484. Right now for UEFI targets an alignment
of 32 is being used for no reason other than support
a rare bytecode. As this is far from the standard case,
removing this alignment and using the default one,
as most toolchains do, should be the desired behavior.
2022-11-20 18:11:43 -05:00
Casey Banner
f746e11879
linker: fail the compilation if there were linker errors
There was no check for linker errors after flushing,
which meant that if the link failed the build would
continue and try to copy the non-existant exe, and
also write the manifest as if it had succeeded.

Also adds parsing of lld output, which is surfaced at the
end of the compilation with the other errors instead
of via stderr
2022-11-19 15:57:08 +02:00
Stevie Hryciw
04f3067a79 run zig fmt on everything checked by CI 2022-11-18 19:22:42 +00:00