aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
AgeCommit message (Collapse)Author
2023-03-04llvm: fix incorrectly annotated DITypeJacob Young
Closes #14715 Closes #14783
2023-02-27llvm: fix untagged struct names in debug info for llvm (again)Jacob Young
At least lldb misbehaves with all these same-named unions, so just generate a unique name.
2023-02-25CBE: replace locals list with a hash mapJacob Young
Replace `ArrayList` with `ArrayHashMap` since we want to be able to remove by element.
2023-02-24CBE: reuse locals with the same `CType` instead of `Type`Jacob Young
Many `Type`s can correspond to the same `CType`, so this reduces the number of used locals by 27760 when compiling only-c. Also, disabled some tests that were only passing by accident and shouldn't really be considered working.
2023-02-23CBE: implement the futureJacob Young
Turns out f(...) will be supported one day.
2023-02-23CBE: apply some maybe payload cleanupsJacob Young
2023-02-23CBE: simplify always_tail call logicJacob Young
It should be Sema's job to check this anyway.
2023-02-23CBE: delete stage1 hacksJacob Young
2023-02-23CType: cleanupJacob Young
2023-02-23CBE: fix MSVC diagnostics generated by the behavior testsJacob Young
After this, the last MSVC warnings are in behavior/bugs/529.zig: behavior.c(37971): warning C4133: 'function': incompatible types - from 'A__8479 *' to 'A__8474 *' behavior.c(37974): warning C4133: 'function': incompatible types - from 'A__8480 *' to 'A__8474 *'
2023-02-23CBE: support call attributesJacob Young
* Support always_tail and never_tail/never_inline with a comptime callee using clang * Support never_inline using gcc * Support never_inline using msvc Unfortunately, can't enable behavior tests because of the conditional support.
2023-02-23CBE: implement c varargsJacob Young
Removed some backend test skip checks for things disabled in std.
2023-02-23CType: fix lowering of generic function pointerJacob Young
2023-02-23CBE: cleanup field accessJacob Young
* Implement @fieldParentPtr on a union * Refactor field access to ensure that it is handled consistently * Remove `renderTypecast` as it is now behaves the same as `renderType`
2023-02-22Merge pull request #14691 from jacobly0/ctypeAndrew Kelley
2023-02-21CBE: fix windows test failuresJacob Young
2023-02-21Sema: implement @fieldParentPtr for unionsIsaac Freund
2023-02-21CBE: fix test failuresJacob Young
2023-02-21CBE: use CType for type definitionsJacob Young
2023-02-21CBE: remove typedef data structuresJacob Young
Adds a new mechanism for `@tagName` function generation that doesn't piggyback on the removed typedef system.
2023-02-20CBE: use stdint.h types instead of `zig_` prefixesJacob Young
This requires manual defines before C99 which may not have stdint.h. Also have update-zig1 leave a copy of lib/zig.h in stage1/zig.h, which allows lib/zig.h to be updated without needing to update zig1.wasm. Note that since the object already existed with the exact same contents, this completely avoids repo bloat due to zig.h changes.
2023-02-20CBE: fix comptime checksJacob Young
2023-02-20CBE: use CType for type renderingJacob Young
2023-02-20CBE: add CType interningJacob Young
2023-02-18update std lib and compiler sources to new for loop syntaxAndrew Kelley
2023-02-11llvm: fix lowerDeclRefValue for extern function aliasesVeikka Tuominen
Same as 0577069af5f5deb859762725736537d60c324453 for extern functions. Closes #14610
2023-02-11zig fmt: do not consider tuples blocksVeikka Tuominen
Closes #14056
2023-02-02Merge pull request #14502 from ziglang/link-owned-atomsJakub Konka
link: move ownership of linker atom from frontend to the linkers
2023-02-01link: make SpirV atoms fully owned by the linkerJakub Konka
2023-01-31move compiler's CType logic to std.TargetAndrew Kelley
This API only depends on std.Target and is extremely useful in build scripts when populating configure files.
2023-01-29cbe: fixes for tls, support for not linking libc, and enabling testskcbanner
- cbe: Implement linksection support, to support TLS when not linking libc - cbe: Support under-aligned variables / struct fields - cbe: Support packed structs (in the C definition of packed) - windows: Fix regression with x86 _tls_array - compiler_rt: Add 128-bit atomics to compiler_rt - tests: Re-enable threadlocal tests on cbe+windows, and llvm+x86 - tests: Re-enable f80 tests that now pass - ci: change windows ci to run the CBE behaviour tests with -lc, to match how the compiler is bootstrapped - update zig1.wasm
2023-01-29cbe: don't emit unused undefined array literalskcbanner
2023-01-23zig fmt fixupkcbanner
2023-01-23cbe: fixes for x86kcbanner
- Emit calling convention - Fix .Naked handling for msvc - Add teb helper for x86 - Fix 128-bit shl implementation when rhs is >= 64 - Add 128-bit shl tests
2023-01-22llvm: implement explicit Win64 and SysV calling conventionsVeikka Tuominen
2023-01-20Merge pull request #14357 from kcbanner/llvm_byval_structVeikka Tuominen
llvm: implement Stdcall calling convention
2023-01-19llvm: implement Stdcall return typesVeikka Tuominen
2023-01-19llvm: pass non-scalars as byref in .Stdcallkcbanner
- add c_abi tests for .Stdcall - enable (x86|x86_64)-windows-gnu in the c_abi tests
2023-01-17windows x86_64 C ABI: pass byref structs as byref_mutVeikka Tuominen
2023-01-17llvm: do not offset packed struct field pointers if they have a host sizeVeikka Tuominen
Closes #14261
2023-01-16Sema: automatically optimize order of struct fieldsVeikka Tuominen
This is a simple starting version of the optimization described in #168 where the fields are just sorted by order of descending alignment.
2023-01-14llvm: correctly handle C ABI structs with f32/f64 alignment differencesVeikka Tuominen
Closes #13830
2023-01-14add C ABI tests for exotic float typesVeikka Tuominen
2023-01-10Fixes bug in AVR codegen for llvm backendFelix "xq" Queißner
2023-01-05llvm codegen: fix f16,f32,f64 nan bitcastsMichael Dusan
@bitCast from integer NaN representation to float NaN resulted in changed bits in float. This only happened with signaled NaN. - added test for signaled NaN - added tests for quiet NaN (for completeness) closes #14198
2023-01-04Sema: implement AVR address spacesMaciej 'vesim' Kuliński
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2023-01-03add -fopt-bisect-limitGuillaume Wenzek
2023-01-02fmt fixupskcbanner
2023-01-01cbe: changes to get zig2.c compiling under msvckcbanner
- Add cpuid / getXCR0 functions for the cbe to use instead of asm blocks - Don't cast between 128 bit types during truncation - Fixup truncation to use functions for shifts / adds - Fixup float casts for undefined values - Add test for 128 bit integer truncation
2023-01-01cbe: fixes for compiling zig2.c under msvckcbanner
- add zig_mul_i128 - render slice structs in static initializers without casts / c99 style init - add negative numbers and u128 to 128-bit multiply test