26738 Commits

Author SHA1 Message Date
Jakub Konka
a09ba455c2
Merge pull request #17791 from ziglang/elf-object
elf: rename ZigModule to ZigObject and move all codegen hooks into it
2023-10-31 07:51:26 +01:00
XXIV
34aac2bae1
std/Thread: remove unnecessary @ptrCast (#17766) 2023-10-31 00:17:39 -04:00
kcbanner
825da34769 Add compile error test case for union layout depending on pointer alignment 2023-10-31 01:35:58 +00:00
kcbanner
fb523c6283 sema: when guessing union alignment, save the result and check if the guess was correct 2023-10-31 01:35:58 +00:00
kcbanner
4d044ee7e0 sema: Add union alignment resolution
- Add resolveUnionAlignment, to resolve a union's alignment only, without triggering layout resolution.
- Update resolveUnionLayout to cache size, alignment, and padding. abiSizeAdvanced and abiAlignmentAdvanced
  now use this information instead of computing it each time.
2023-10-31 01:35:58 +00:00
Andrew Kelley
ffaeb45333 langref: clarify struct memory layout 2023-10-30 16:27:12 -07:00
Krzysztof Wolicki
1880c799ae
autodoc: Some support for field_call (#16853)
* autodoc: Some support for field_call

* autodoc: Change handling of field_call to respect tryResolveRefPath, add fieldVal to Expr

* autodoc: Fixed errors

* autodoc: sync with latest master changes

---------

Co-authored-by: Loris Cro <kappaloris@gmail.com>
2023-10-30 21:04:49 +00:00
Karl Seguin
f52a228a5d
Fix http.Headers.initList
Use correct return type (error union), cast field length for hashmap capacity.
2023-10-30 20:35:24 +00:00
Jakub Konka
ea95c74948 elf: encapsulate ZigObject-specific logic in flushModule hook 2023-10-30 20:36:34 +01:00
Jakub Konka
b1a735ac65 elf: put init logic of ZigObject in init function 2023-10-30 19:44:27 +01:00
Jakub Konka
9bdbb6312f elf: move incremental codegen bits into ZigObject.zig 2023-10-30 19:09:13 +01:00
Jakub Konka
b2e847a41a elf: rename ZigModule to ZigObject 2023-10-30 19:09:13 +01:00
Jakub Konka
10d03acdb5
Merge pull request #17773 from ziglang/elf-exports
link: implement exporting anon decls
2023-10-30 17:29:05 +01:00
Jakub Konka
324a93e673 coff: implement enough of extern handling to pass comptime export tests 2023-10-30 12:44:50 +01:00
Jakub Konka
2e690f5c74 macho: implement enough of extern handling to pass comptime export tests 2023-10-30 00:09:32 +01:00
DilithiumNitrate
91e117697a
Fix hasRuntimeBitsAdvanced lazy case for pointers and optionals
As suggested by mlugg, always returns `error.NeedLazy`. If this has a
performance impact, it could be replaced by adding lazy handling to
`comptimeOnlyAdvanced`.
2023-10-29 21:12:43 +00:00
Jakub Konka
71dfea1f17 coff: implement exporting anon decls 2023-10-29 18:55:58 +01:00
Jakub Konka
a7a95ce9c4 macho: implement exporting anon decls 2023-10-29 18:55:58 +01:00
Jakub Konka
eaca72534c elf: implement exporting anon decls 2023-10-29 18:55:58 +01:00
Jakub Konka
209fd8cb93 elf: add partial implementation of exporting anon decls 2023-10-29 18:55:58 +01:00
Andrew Kelley
fa022d1ecc
Merge pull request #17759 from jacobly0/x86_64
x86_64: pass more tests
2023-10-29 13:10:51 -04:00
Jacob Young
f6f2708d82 x86_64: fix compiler rt test failures 2023-10-29 07:20:36 -04:00
Jacob Young
1fecf86ebf x86_64: refactor codegen memory repr
Also refactor linker reloc lowering.
2023-10-29 05:17:43 -04:00
Jacob Young
20ade4ce7f tests: change some x86_64 backend targets to pic for more coverage 2023-10-29 05:15:35 -04:00
Jacob Young
f133bcba9f x86_64: fix hazard between pic call and sysv cc 2023-10-29 05:15:35 -04:00
Kamil T
37295696ec std.os.windows additions and fixes 2023-10-29 11:01:54 +02:00
Andrew Kelley
e7ead9c5ea std: delete psapi, gdi32, and winmm
The only remaining Windows APIs now are the ones that the standard
library itself depends on for its cross-platform abstractions.

closes #4426
2023-10-29 00:58:00 -04:00
Jakub Konka
13c7aa5fef
Merge pull request #17727 from ziglang/elf-memory-deferred
x86_64+elf: do not pass hardcoded memory addresses in prep for build-obj
2023-10-28 19:41:07 +02:00
Andrew Kelley
d817a3c517 delete std.os.windows.user32
This is progress towards #4426
Closes #17417
2023-10-28 13:16:47 -04:00
Andrew Kelley
e69fd4d696
Merge pull request #17762 from ziglang/zir-index-type-safety
make Zir.Inst.Index typed
2023-10-28 13:14:40 -04:00
Andrew Kelley
62f45b802c make Zir.Inst.Index typed
This commit starts by making Zir.Inst.Index a nonexhaustive enum rather
than a u32 alias for type safety purposes, and the rest of the changes
are needed to get everything compiling again.
2023-10-28 10:14:15 -07:00
Andrew Kelley
49b9e1e69b std.mem.minMax: make it return a tuple
this is a breaking change
2023-10-28 10:14:15 -07:00
Andrew Kelley
256ab68a97 frontend: make Decl.zir_decl_index typed
This field had the wrong type. It's not a `Zir.Inst.Index`, it's
actually a `Zir.OptionalExtraIndex`. Also, the former is currently
aliased to `u32` while the latter is a nonexhaustive enum that gives us
more type checking.

This commit is preparation for making this field non-optional. Now it
can be changed to `Zir.ExtraIndex` and then the compiler will point out
all the places that the non-optional assumption is being violated.
2023-10-28 04:30:27 -04:00
Jacob Young
12b5c8156a x86_64: handle .load_symbol in more places 2023-10-28 03:51:05 -04:00
Jakub Konka
20a3664153 x86_64: handle .load_symbol in mul_with_overflow and mul_div 2023-10-28 03:48:18 -04:00
Jakub Konka
396003fb06 x86_64: assert fixes are ._ for linker_reloc 2023-10-28 03:48:18 -04:00
Jakub Konka
493f786b38 x86_64: refactor Lower.zig 2023-10-28 03:48:18 -04:00
Jakub Konka
df7db0c4be x86_64: pass behavior tests PIC and non-PIC 2023-10-28 03:48:18 -04:00
Jakub Konka
2be1250f24 x86_64: no more load/lea_symbol weirdness 2023-10-28 03:48:18 -04:00
Jakub Konka
0d00b7c585 elf: set needs_got on generated extern vars 2023-10-28 03:48:18 -04:00
Jakub Konka
9a1fbb2705 x86_64: rename load/lea_memory to load/lea_symbol 2023-10-28 03:48:18 -04:00
Jakub Konka
a6a10d9c2b x86_64: do not hardcode memory passed by Elf linker 2023-10-28 03:48:18 -04:00
XXIV
9ff9ea38ea
compiler_rt/emutls: remove unnecessary @ptrCast (#17755) 2023-10-28 02:27:58 -04:00
mlugg
c1c9bc0c41 Sema: do not assume switch item indices align with union field indices
Resolves: #17754
2023-10-28 06:30:28 +01:00
Andrew Kelley
5257643d3d
Merge pull request #17747 from ziglang/organize-behavior-tests
categorize behavior tests
2023-10-28 00:00:40 -04:00
Jacob Young
a440cf6d44 x86_64: fix c abi test failures 2023-10-27 23:31:20 -04:00
expikr
aecdf6ad50
Doc: elaborate on Slice section
somehow the concept of slices had less elaboration in its own dedicated section than the mentions of it elsewhere.
2023-10-27 23:11:56 +00:00
Andrew Kelley
24d9438bcc split export behavior test into export_keyword and export_builtin 2023-10-27 12:45:04 -07:00
Andrew Kelley
9f0fd72321 categorize nan behavior test
move it from bugs/xxx.zig to its own category
2023-10-27 12:43:34 -07:00
Andrew Kelley
3fb301b16a categorize fn ptr behavior test
move a function pointer test from bugs/xxx.zig to fn.zig
2023-10-27 12:43:34 -07:00