aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.zig
AgeCommit message (Collapse)Author
2024-03-11std.builtin: make container layout fields lowercaseTristan Ross
2024-03-06InternPool: create specialized functions for loading namespace typesmlugg
Namespace types (`struct`, `enum`, `union`, `opaque`) do not use structural equality - equivalence is based on their Decl index (and soon will change to AST node + captures). However, we previously stored all other information in the corresponding `InternPool.Key` anyway. For logical consistency, it makes sense to have the key only be the true key (that is, the Decl index) and to load all other data through another function. This introduces those functions, by the name of `loadStructType` etc. It's a big diff, but most of it is no-brainer changes. In future, it might be nice to eliminate a bunch of the loaded state in favour of accessor functions on the `LoadedXyzType` types (like how we have `LoadedUnionType.size()`), but that can be explored at a later date.
2024-02-26move Zir to std.zig.ZirAndrew Kelley
Part of an effort to ship more of the compiler in source form.
2024-02-25x86_64: implement `@shuffle`Jacob Young
2024-02-16InternPool: make more use of `NullTerminatedString.Slice`Jacob Young
This should avoid the random pointer invalidation crashes. Closes #18954
2024-02-05compiler: rename value.zig to Value.zigAndrew Kelley
This commit only does the file rename to be friendlier to version control conflicts.
2024-02-02InternPool: use separate key for slicesmlugg
This change eliminates some problematic recursive logic in InternPool, and provides a safer API.
2024-01-24macho: prep for lowering TLS variablesJakub Konka
2024-01-24macho: fix '_' prefixing rules for exportsJakub Konka
2024-01-24macho: fix symbol index dereference in codegen wrt ZigObjectJakub Konka
This is incredibly confusing and I really need to simplify it. Elf also possesses this shortcoming so once I get Coff up to speed it should hopefully become clear on how to refactor this.
2024-01-24codegen: implement more missing bitsJakub Konka
2024-01-24codegen: re-implement enough of codegen to error out instead panicJakub Konka
2024-01-24codegen: re-enable MachO support in genDeclRefJakub Konka
2024-01-24macho: get the ball rolling!Jakub Konka
2024-01-01frontend: fix handling of special builtin moduleAndrew Kelley
it's allocated differently and imported differently
2024-01-01fix a round of compile errors caused by this branchAndrew Kelley
2024-01-01compiler: update references to targetAndrew Kelley
2024-01-01update references to module (to be renamed to zcu)Andrew Kelley
2024-01-01compiler: update references to single_threadedAndrew Kelley
2023-12-04x86_64: implement more operations on vectors with 1-bit elementsJacob Young
2023-12-03x86_64: implement more compliant vectorsJacob Young
2023-12-01test: test with `-fstrip` and fix failuresJacob Young
Closes #17513
2023-11-26move Module.Decl.Index and Module.Namespace.Index to InternPoolMeghan Denny
2023-11-25convert `toType` and `toValue` to `Type.fromInterned` and `Value.fromInterned`Techatrix
2023-11-19compiler: correct unnecessary uses of 'var'mlugg
2023-11-12x86_64: resolve tlv references on first use and spill to the stackJacob Young
This avoids any arbitrary memory operand possibly clobbering rax and sometime rdi with no warning.
2023-11-12elf: set symbol flags such as needs_zig_got in ZigObjectJakub Konka
2023-11-04Merge pull request #17844 from ziglang/elf-objectJakub Konka
elf: handle emitting relocatables and static libraries - humble beginnings
2023-11-04elf: postpone creation of .got.zig entry until code emitJakub Konka
2023-11-04elf: make sure we never emit .got.zig relocs when linking object filesJakub Konka
2023-11-03x86_64: fix std test failuresJacob Young
2023-10-30elf: move incremental codegen bits into ZigObject.zigJakub Konka
2023-10-30elf: rename ZigModule to ZigObjectJakub Konka
2023-10-30coff: implement enough of extern handling to pass comptime export testsJakub Konka
2023-10-30macho: implement enough of extern handling to pass comptime export testsJakub Konka
2023-10-28x86_64: no more load/lea_symbol weirdnessJakub Konka
2023-10-28elf: set needs_got on generated extern varsJakub Konka
2023-10-28x86_64: rename load/lea_memory to load/lea_symbolJakub Konka
2023-10-28x86_64: do not hardcode memory passed by Elf linkerJakub Konka
2023-10-25x86_64: pass more testsJacob Young
* 128-bit integer multiplication with overflow * more instruction encodings used by std inline asm * implement the `try_ptr` air instruction * follow correct stack frame abi * enable full panic handler * enable stack traces
2023-10-24InternPool: remove runtime_value representationmlugg
The main goal of this commit is to remove the `runtime_value` field from `InternPool.Key` (and its associated representation), but there are a few dominos. Specifically, this mostly eliminates the "maybe runtime" concept from value resolution in Sema: so some resolution functions like `resolveMaybeUndefValAllowVariablesMaybeRuntime` are gone. This required a small change to struct/union/array initializers, to no longer use `runtime_value` if a field was a `variable` - I'm not convinced this case was even reachable, as `variable` should only ever exist as the trivial value of a global runtime `var` decl. Now, the only case in which a `Sema.resolveMaybeUndefVal`-esque function can return the `variable` key is `resolveMaybeUndefValAllowVariables`, which is directly called from `Sema.resolveInstValueAllowVariables` (previously `Sema.resolveInstValue`), which is only used for resolving the value of a Decl from `Module.semaDecl`. While changing these functions, I also slightly reordered and restructured some of them, and updated their doc comments.
2023-10-23Merge pull request #17651 from Vexu/error-limitAndrew Kelley
Make distinct error limit configurable (attempt #2)
2023-10-22Revert "Revert "Merge pull request #17637 from jacobly0/x86_64-test-std""Jacob Young
This reverts commit 6f0198cadbe29294f2bf3153a27beebd64377566.
2023-10-22Revert "Merge pull request #17637 from jacobly0/x86_64-test-std"Andrew Kelley
This reverts commit 0c99ba1eab63865592bb084feb271cd4e4b0357e, reversing changes made to 5f92b070bf284f1493b1b5d433dd3adde2f46727. This caused a CI failure when it landed in master branch due to a 128-bit `@byteSwap` in std.mem.
2023-10-22Merge pull request #17637 from jacobly0/x86_64-test-stdJacob Young
x86_64: start to enable `test-std` and `test-compiler-rt` testing
2023-10-22remove uses of non-configurable `err_int`Veikka Tuominen
2023-10-21codegen: implement lowering aligned anon declsJacob Young
2023-10-21InternPool: store alignment of anon declsAndrew Kelley
Commit 5393e56500d499753dbc39704c0161b47d1e4d5c has a flaw pointed out by @mlugg: the `ty` field of pointer values changes when comptime values are pointer-casted. This commit introduces a new encoding which additionally stores the "original pointer type" which is used to store the alignment of the anonymous decl, and potentially other information in the future such as section and pointer address space. However, this new encoding is only used when the original pointer type differs from the casted pointer type in a meaningful way. I was able to make the LLVM backend and the C backend lower anonymous decls with the appropriate alignment, however I will need some help figuring out how to do this for the backends that lower anonymous decls via src/codegen.zig and the wasm backend.
2023-10-21x86_64: disable difficult std tests and hack around more zero-bit typesJacob Young
2023-10-16codegen: refactor .actual_got into .extern_gotJakub Konka