aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
AgeCommit message (Collapse)Author
2022-12-18llvm: avoid creating an invalid llvm typeJacob Young
Fixes the following assertion: ``` zig: llvm/lib/IR/Type.cpp:729: static llvm::PointerType* llvm::PointerType::get(llvm::Type*, unsigned int): Assertion `isValidElementType(EltTy) && "Invalid type for pointer element!"' failed. ```
2022-12-18llvm: fix lowering pointer to final zero-width field of a comptime valueJacob Young
* Handle a `null` return from `llvmFieldIndex`. * Add a behavior test to test this code path. * Reword this test name, which incorrectly described how pointers to zero-bit fields behave, and instead describe the actual test.
2022-12-18Merge pull request #13914 from Vexu/variadicAndrew Kelley
implement defining C variadic functions
2022-12-18Revert "llvm: fix lowering pointer to final zero-width field of a comptime ↵Andrew Kelley
value" This reverts commit e0bc5f65b98d154b4318027d56f780b55605e33c. Caused an assertion failure when running the behavior tests: ``` zig: llvm/lib/IR/Type.cpp:729: static llvm::PointerType* llvm::PointerType::get(llvm::Type*, unsigned int): Assertion `isValidElementType(EltTy) && "Invalid type for pointer element!"' failed. Aborted (core dumped) ```
2022-12-18Merge pull request #13930 from r00ster91/renamingsVeikka Tuominen
std.builtin: renamings
2022-12-18llvm: fix lowering pointer to final zero-width field of a comptime valueJacob Young
* Handle a `null` return from `llvmFieldIndex`. * Add a behavior test to test this code path. * Reword this test name, which incorrectly described how pointers to zero-bit fields behave, and instead describe the actual test.
2022-12-17std.builtin: rename Type.UnionField and Type.StructField's field_type to typer00ster91
2022-12-17implement defining C variadic functionsVeikka Tuominen
2022-12-17zig fmt: fix extra whitespace with multiline stringsyujiri8
Fixes #13937
2022-12-16codegen - lower str_lit to vectorTravis Staloch
2022-12-15port packed vector elem ptr logic from stage1Veikka Tuominen
Closes #12812 Closes #13925
2022-12-13remove `stack` option from `@call`Veikka Tuominen
2022-12-10CBE: fix compiling for aarch64-windowsJacob Young
These bugs were triggered in the C backend by aarch64-specific code in os/windows.zig. Intentionally not updating zig1.wasm yet because of upcoming changes and since aarch64-windows is not tested on master yet.
2022-12-09Eliminate `BoundFn` type from the languageVeikka Tuominen
Closes #9484
2022-12-09llvm: resolve all relative paths when creating DIFilesJakub Konka
This will make stack traces and debugging experience more consistent in the sense that the presence of source lines in stack traces will not be dependent on the current working directory of the running process.
2022-12-06remove most conditional compilation based on stage1Andrew Kelley
There are still a few occurrences of "stage1" in the standard library and self-hosted compiler source, however, these instances need a bit more careful inspection to ensure no breakage.
2022-12-06CBE: avoid trailing spaceJacob Young
2022-12-06CBE: add windows-specific reserved identifiersJacob Young
2022-12-06CBE: fix bad local reuse for volatile memsetJacob Young
2022-12-04CBE: revert broken change that got missedJacob Young
2022-12-04CBE: defer invariant local reuse in loopsJacob Young
When a local defined outside a loop dies inside the loop, it can still be needed on subsequent loop iterations, so reuse of the local must be deferred until after the loop ends. This causes behavior tests to pass.
2022-12-04CBE: fix liveness issue with wrapping optionalsAndrew Kelley
2022-12-04CBE: remove stray commentAndrew Kelley
2022-12-04CBE: fix union init wrong field nameAndrew Kelley
2022-12-04CBE: aggregate_init: resolve all operands before processing LivenessAndrew Kelley
2022-12-04CBE and LLVM: handle unused try instructionsAndrew Kelley
In both backends they did not observe the Liveness information for try instructions. Now they do. For the C backend this is necessary for correctness; for the LLVM backend, it improves code generation.
2022-12-04CBE: fix various regressions caught by behavior testsAndrew Kelley
2022-12-04CBE: fix static allocs being double allocatedAndrew Kelley
2022-12-04CBE: avoid curly inits because they don't work in assignmentsAndrew Kelley
2022-12-04CBE: fix use-after-free of Type keys in free_locals mapAndrew Kelley
2022-12-04CBE: fix assignment expr and switch free trackingAndrew Kelley
2022-12-04CBE: fix clone of freed locals not being deep cloneAndrew Kelley
2022-12-04CBE: take advantage of switch_br and cond_br livenessAndrew Kelley
2022-12-04CBE: exploit Liveness analysis to reuse localsAndrew Kelley
2022-12-04Revert "cbe: reduce amount of temporary locals"Andrew Kelley
This reverts commit 15cc83e27ae8a1740d9b7e2ec14044903979a832.
2022-12-04Revert "cbe: write more instructions inline"Andrew Kelley
This reverts commit f8b779c114a5fcb82f08168912f2300d7027a2fd.
2022-12-03cbe: add forward declarations for optionals and error unionsJacob Young
Arrays will have to wait for type rewrite.
2022-12-03cbe: implement function alignmentJacob Young
2022-12-03cbe: fix zero-bit struct field pointerJacob Young
2022-12-03cbe: implement multiple exports of a symbolsJacob Young
2022-12-03cbe: don't emit extern decls that are already exportedJacob Young
2022-12-03cbe: fix named constraints without modifiersJacob Young
2022-12-03CBE: no braces when lowering block instructionAndrew Kelley
This change alone solves the bracket-depth issue when compiling zig1.c with Clang.
2022-12-03Merge pull request #13748 from jacobly0/c-unalignedAndrew Kelley
cbe: use memcpy for underaligned loads and stores
2022-12-03Merge pull request #13744 from Vexu/stage2-fixesAndrew Kelley
Improve error messages, fix dependency loops
2022-12-02cbe: add support for constraint modifiers specified after a colonJacob Young
This translates `%[name:mod]` to `%mod[name]` for C.
2022-12-02cbe: use memcpy for underaligned loads and storesJacob Young
2022-12-02CBE: use bool, true, false, instead of `zig_` prefixesAndrew Kelley
In general the C backend should lower to human-maintainable C code whenever possible. Directly using C types that one would use when writing C code is one part of the strategy. The concern with including stdint.h is C89 compatibility. Well, we can just check the C std lib version before deciding to include that header.
2022-12-02CBE: use a 0 literal instead of `error.@"(no error)"`Andrew Kelley
This saves bytes and is easier to read too.
2022-12-03Sema: fix comparisons between lazy and runtime valuesVeikka Tuominen
Closes #12498