Commit Graph

15025 Commits

Author SHA1 Message Date
David Rubin 7591df5172 ip: use getExternFunc in getCoerced
`ip.get` specifically doesn't allow `extern_func` keys to access it.
2024-07-21 01:00:49 -07:00
cheme 01dc0d5a72 Riscv32e align stack to 4 bytes (#20673) 2024-07-21 00:28:22 -07:00
Andrew Kelley 397be0c9cc Merge pull request #20380 from tau-dev/master
llvm: Nest debug info correctly
2024-07-21 00:19:52 -07:00
WillLillis 18d412ab2f fix: remove misleading error note for failed array coercions 2024-07-21 00:10:36 -07:00
Will Lillis 9b292c0949 fix: Add error notes for method calls on double pointers (#20686) 2024-07-21 00:03:23 -07:00
Andrew Kelley 93c546c8c9 Merge pull request #20692 from pavelverigo/stage2-wasm-overflow-ops
stage2-wasm: overflow ops improvement
2024-07-20 23:57:14 -07:00
Andrew Kelley ff02bf403b Merge pull request #20402 from alexrp/target-cleanup
std.Target: Remove some obsolete/dead specifiers.
2024-07-20 13:55:37 -07:00
Robin Voetter 6d7bbab740 Merge pull request #20696 from sobolevn/typos-fix
Fix typos in code comments in `src/`
2024-07-20 22:28:42 +02:00
Andrew Kelley b5f3d12164 Merge pull request #20688 from ziglang/incr-test
introduce a new tool for testing incremental compilation
2024-07-20 13:04:49 -07:00
sobolevn 4c71d3f29e Fix typos in code comments in src/ 2024-07-20 20:23:18 +03:00
Jacob Young 5424239154 dev: add missing x86_64 backend checks 2024-07-20 07:43:53 -04:00
Jacob Young 2e65244cae dev: fix llvm backend checks 2024-07-20 07:43:40 -04:00
Pavel Verigo f5dd6fb71a stage2-wasm: @mulWithOverflow fixes + 128 bit signed 2024-07-20 13:21:46 +02:00
Andrew Kelley eb4028bf30 add std.fmt.hex
converts an unsigned integer into an array
2024-07-20 01:06:29 -07:00
Jacob Young 4f742c4cfc dev: introduce dev environments that enable compiler feature sets 2024-07-19 22:35:33 -07:00
Alex Rønne Petersen 5e82e90dbf std.Target: Remove coreclr ABI specifier.
This was added to LLVM in 2015 for the LLILC project, which was discontinued in
~2018, and subsequently archived in 2022.

https://github.com/dotnet/llilc/commit/933b58d00ffb4b357956c940b37a379bdf891324
2024-07-20 05:08:16 +02:00
Alex Rønne Petersen af8205e25e std.Target: Remove nacl OS specifier and le32/le64 arch specifiers.
Native Client is dead.

https://developer.chrome.com/docs/native-client
2024-07-20 05:08:16 +02:00
Alex Rønne Petersen 5a2f6acb44 std.Target: Remove kfreebsd OS specifier.
kFreeBSD is dead.

https://lists.debian.org/debian-devel/2023/07/msg00176.html
2024-07-20 05:08:14 +02:00
Alex Rønne Petersen 9939b116bf std.Target: Remove the gnuf64 ABI specifier.
This was used for LoongArch64, where:

* `gnuf64` -> `ilp32d` / `lp64d` (full hard float)
* `gnuf32` -> `ilp32f` / `lp64f` (hard float for `f32` only)
* `gnusf` -> `ilp32` / `lp64` (soft float)

But Loongson eventually settled on just `gnu` for the first case since that's
what most people will actually be targeting outside embedded scenarios. The
`gnuf32` and `gnusf` specifiers remain in use.
2024-07-20 04:56:56 +02:00
Tau 94cf4d2d81 llvm: add pass-by-reference info to debug types
Without this data, debugger expressions try to pass structs by-value,
which mostly just crashes.
Also: mark enums as enum classes to prevent the enumerators from
shadowing other identifiers.
2024-07-19 17:51:38 +02:00
Tau 177b3359a1 llvm: Do not generate static member definitions
They were not helping LLDB and actively throwing off GDB.
Also: clean up some llvm.Builder and llvm.ir definitions that are no
longer necessary.
2024-07-19 17:51:38 +02:00
Tau 52e4cdb45e Try linking static members' definitions to their declarations.
This does not help anything though: gdb would follow the
DW_AT_specification link only in the opposite direction, which LLVM
cannot emit.
2024-07-19 17:51:38 +02:00
Tau 3bfa63aa61 ModuleDebugInfo: Discard C++ namespaces appearing in PDBs 2024-07-19 17:51:38 +02:00
Tau 9c2d597e69 llvm: Fix debug gen for 0-bit types
Add a regression test for that, since these weirdly never occur in any
of the other tests on x86-64-linux.
2024-07-19 17:51:38 +02:00
Tau b4eb812305 Don't attach a top-level function to its file, but to the file's struct 2024-07-19 17:51:38 +02:00
Tau 359bbdd574 llvm: encode variables as DW_TAG_imported_declaration
Now we get working global variable lookup in GDB! LLDB still re-mangles,
and it looks like we can't do much about that for now.

Also: translate non-owning type declarations into typedefs.
2024-07-19 17:51:37 +02:00
Tau 876258abe4 llvm: set precise scopes on namespace types and variables
This will allow accessing non-local declarations from debuggers, which,
AFAICT, was impossible before.
Getting scopes right already works for type declarations and functions,
but will need some fiddling for variables:

For those, I tried imitating what Clang does for static member
variables, but LLDB tries to re-mangle those and then fails at lookup,
while GDB outright crashes. Hopefully I can find some other dwarven
incantation to do the right thing.
2024-07-19 17:46:34 +02:00
Andrew Kelley 8c4a2dc1df move non-libc stuff out of std.c 2024-07-19 00:30:32 -07:00
mlugg f5a941b3d6 Sema: return module-relative path for @src()
This is one possible approach to fixing an issue with reproducible
builds where the compiler's cwd changes the paths returned by `@src()`.
2024-07-18 18:45:07 +01:00
Pavel Verigo 56d535dd24 stage2-wasm: improve @shlWithOverflow for <= 128 bits
Additionally fixed a bug for shr on signed big ints
2024-07-18 18:01:06 +02:00
Pavel Verigo dc3176d628 stage2-wasm: enhance add/subWithOverflow
Added behavior tests to verify implementation
2024-07-18 17:54:44 +02:00
Pavel Verigo d1bd9518f9 stage2-wasm: fix big int comparison
Unexpected to be found only now
2024-07-18 17:18:17 +02:00
Jakub Konka 3bdbf81a3f macho: fix emitting data-in-code entries 2024-07-18 09:13:09 +02:00
Jakub Konka 34f34dbe32 macho: reinstate duplicate definition checking 2024-07-18 09:13:09 +02:00
Jakub Konka b339a30680 macho: fix off-by-one when populating strtab 2024-07-18 09:13:09 +02:00
Jakub Konka e9328e7da8 macho: fix 32bit compilation issues 2024-07-18 09:13:09 +02:00
Jakub Konka 3338813077 macho: use isec for working out getAtomData in ZigObject 2024-07-18 09:13:09 +02:00
Jakub Konka a9e3088d9c macho: extract testing logic for TLS into a helper 2024-07-18 09:13:08 +02:00
Jakub Konka 103c16c879 macho: clean up atom+symbol creation logic in ZigObject 2024-07-18 09:13:08 +02:00
Jakub Konka e117e05768 macho: ensure we always name decls like LLVM to avoid confusion 2024-07-18 09:13:08 +02:00
Jakub Konka 91de8dc8ab macho: fix unresolved symbols error reporting 2024-07-18 09:13:08 +02:00
Jakub Konka 521933e1c0 macho: do not randomly append non-incr atoms in ZigObject 2024-07-18 09:13:08 +02:00
Jakub Konka 234aa86802 macho: update non-incremental section sizes for ZigObject sections 2024-07-18 09:13:08 +02:00
Jakub Konka 387a71fa5b macho: re-enable writing out static archive with ZigObject 2024-07-18 09:13:08 +02:00
Jakub Konka 84189f9d56 macho: skip resizing incremental Zig sections in r mode 2024-07-18 09:13:08 +02:00
Jakub Konka 129fe8668c macho: write non-incremental atoms in ZigObject 2024-07-18 09:13:08 +02:00
Jakub Konka e5a66184ed macho: pretty print relocation types in logs and errors 2024-07-18 09:13:08 +02:00
Jakub Konka 01fc33c949 macho: emit relocs for non-zig-sections in ZigObject 2024-07-18 09:13:08 +02:00
Jakub Konka 853ca403c4 macho: bring back relocatable mode for ZigObject 2024-07-18 09:13:08 +02:00
Jakub Konka cba04ff244 macho: re-enable calculating num of relocs for ZigObject 2024-07-18 09:13:08 +02:00