aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c
AgeCommit message (Collapse)Author
2023-06-10compiler: move error union types and error set types to InternPoolAndrew Kelley
One change worth noting in this commit is that `module.global_error_set` is no longer kept strictly up-to-date. The previous code reserved integer error values when dealing with error set types, but this is no longer needed because the integer values are not needed for semantic analysis unless `@errorToInt` or `@intToError` are used and therefore may be assigned lazily.
2023-06-10compiler: eliminate legacy Type.Tag.pointerAndrew Kelley
Now pointer types are stored only in InternPool.
2023-06-10stage2: move function types to InternPoolAndrew Kelley
2023-06-10stage2: move anon tuples and anon structs to InternPoolAndrew Kelley
2023-06-10stage2: move union types and values to InternPoolAndrew Kelley
2023-06-10stage2: move struct types and aggregate values to InternPoolAndrew Kelley
2023-06-10stage2: move opaque types to InternPoolAndrew Kelley
2023-06-10stage2: implement intTagType logicAndrew Kelley
This commit changes a lot of `*const Module` to `*Module` to make it work, since accessing the integer tag type of an enum might need to mutate the InternPool by adding a new integer type into it. An alternate strategy would be to pre-heat the InternPool with the integer tag type when creating an enum type, which would make it so that intTagType could accept a const Module instead of a mutable one, asserting that the InternPool already had the integer tag type.
2023-06-10InternPool: add a slice encodingAndrew Kelley
This uses the data field to reference its pointer field type, which allows for efficient and infallible access of a slice type's pointer type.
2023-06-10stage2: move many Type encodings to InternPoolAndrew Kelley
Notably, `vector`. Additionally, all alternate encodings of `pointer`, `optional`, and `array`.
2023-06-10stage2: move all integer types to InternPoolAndrew Kelley
2023-06-10stage2: move named int types to InternPoolAndrew Kelley
2023-06-10stage2: move float types to InternPoolAndrew Kelley
2023-06-10stage2: start the InternPool transitionAndrew Kelley
Instead of doing everything at once which is a hopelessly large task, this introduces a piecemeal transition that can be done in small increments at a time. This is a minimal changeset that keeps the compiler compiling. It only uses the InternPool for a small set of types. Behavior tests are not passing. Air.Inst.Ref and Zir.Inst.Ref are separated into different enums but compile-time verified to have the same fields in the same order. The large set of changes is mainly to deal with the fact that most Type and Value methods now require a Module to be passed in, so that the InternPool object can be accessed.
2023-05-26std.Target adjustmentsVeikka Tuominen
* move `ptrBitWidth` from Arch to Target since it needs to know about the abi * double isn't always 8 bits * AVR uses 1-byte alignment for everything in GCC
2023-05-23std.sort: add pdqsort and heapsortAli Chraghi
2023-04-25cbe: fix mutability issues with builtin test_functionsJacob Young
2023-04-13add c_char typeAndrew Kelley
closes #875
2023-03-05CBE: implement vector element pointersJacob Young
2023-03-05CBE: fix behavior test failures on msvcJacob Young
2023-03-05CBE: implement big integer and vector comparisonsJacob Young
2023-03-05CBE: implement big integer literalsJacob Young
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-23CType: cleanupJacob Young
2023-02-23CType: fix lowering of generic function pointerJacob Young
2023-02-21CBE: fix windows 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: add CType interningJacob Young