21 Commits

Author SHA1 Message Date
Andrew Kelley
9d422bff18 stage2: move all integer types to InternPool 2023-06-10 20:40:04 -07:00
Andrew Kelley
bcd4bb8afb stage2: move named int types to InternPool 2023-06-10 20:40:04 -07:00
Andrew Kelley
4cd8a40b3b stage2: move float types to InternPool 2023-06-10 20:40:03 -07:00
Andrew Kelley
9aec2758cc stage2: start the InternPool transition
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-06-10 20:40:03 -07:00
Veikka Tuominen
ca16f1e8a7 std.Target adjustments
* 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-26 21:42:19 -07:00
Ali Chraghi
3db3cf7790 std.sort: add pdqsort and heapsort 2023-05-23 17:55:59 -07:00
Jacob Young
a1fcb51692 cbe: fix mutability issues with builtin test_functions 2023-04-25 13:42:10 -04:00
Andrew Kelley
e2fe1907ec add c_char type
closes #875
2023-04-13 02:47:16 -04:00
Jacob Young
8f6da78fb1 CBE: implement vector element pointers 2023-03-05 02:59:02 -05:00
Jacob Young
9e3a5ecd39 CBE: fix behavior test failures on msvc 2023-03-05 02:59:02 -05:00
Jacob Young
a8f4ac2b94 CBE: implement big integer and vector comparisons 2023-03-05 02:59:01 -05:00
Jacob Young
874ae81f1b CBE: implement big integer literals 2023-03-05 02:59:01 -05:00
Jacob Young
1453a595aa CBE: reuse locals with the same CType instead of Type
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-24 23:41:54 -05:00
Jacob Young
8ccdc74949 CType: cleanup 2023-02-23 20:30:59 -05:00
Jacob Young
597e8011f7 CType: fix lowering of generic function pointer 2023-02-23 00:29:23 -05:00
Jacob Young
248fb40dcc CBE: fix windows test failures 2023-02-21 15:46:34 -05:00
Jacob Young
064b355912 CBE: use CType for type definitions 2023-02-21 00:00:19 -05:00
Jacob Young
cf7200e8f9 CBE: remove typedef data structures
Adds a new mechanism for `@tagName` function generation that doesn't
piggyback on the removed typedef system.
2023-02-21 00:00:19 -05:00
Jacob Young
3eed197c95 CBE: use stdint.h types instead of zig_ prefixes
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-20 23:59:48 -05:00
Jacob Young
d513792afa CBE: fix comptime checks 2023-02-20 23:48:36 -05:00
Jacob Young
d8fada6b63 CBE: add CType interning 2023-02-20 23:48:36 -05:00