11734 Commits

Author SHA1 Message Date
Jacob Young
3b1ea390a3 x86_64: cleanup lazy symbols
In theory fixes updating lazy symbols during incremental compilation.
2023-05-01 19:22:53 -04:00
Jacob Young
db88b41472 x86_64: fix switch multi-prongs and mul/div flags clobber 2023-05-01 19:22:53 -04:00
Jakub Konka
565f8979cc link: fix accessing source atom's symbol index in codegen
Since the owner can either be a `Decl` or a `LazySymbol` we need
to preserve this information at the codegen generate function level
so that we can then correctly work out the corresponding `Atom`
in the linker.
2023-05-01 19:22:52 -04:00
Jakub Konka
7064d7dbf0 Revert "x86_64: workaround tagName linker issues"
This reverts commit aac97b92532e7492b9145e1562e31c2e1fa66c15.
2023-05-01 19:22:52 -04:00
Jacob Young
0bdfb288cc x86_64: workaround tagName linker issues
Pass extra pointer param with a linker ref when calling the lazy tagName
function to workaround not being able to lower linker refs during
codegen of a lazy func.
2023-05-01 19:22:52 -04:00
Jacob Young
47a34d038d x86_64: implement tagName 2023-05-01 19:22:52 -04:00
Jacob Young
0489a63a43 Sema: use trap for backends that don't support panic_fn
Debuggers also catch trap, but the code is not allowed to continue.
2023-05-01 19:22:52 -04:00
Jacob Young
19bd7d12b0 x86_64: factor out lazy_sym 2023-05-01 19:22:52 -04:00
Jacob Young
372bc960b8 link: update decl-specific lazy symbols 2023-05-01 19:22:52 -04:00
Jacob Young
f37ca3fa73 link: cleanup lazy alignment
This gets the alignment from the code that creates a lazy symbol instead
of guessing it at every use.
2023-05-01 19:22:52 -04:00
Jacob Young
c81878978a x86_64: optimize wide mul with overflow 2023-05-01 19:22:52 -04:00
Jacob Young
3c2636a83d x86_64: implement more forms of wide mul with overflow 2023-05-01 19:22:52 -04:00
Jacob Young
c388960042 x86_64: fix large not and atomicrmw 2023-05-01 19:22:52 -04:00
Jacob Young
aaef5288f8 x86_64: fix 128-bit cmpxchg 2023-05-01 19:22:52 -04:00
Jacob Young
50f96c2949 x86_64: fix stack realignment 2023-05-01 19:22:52 -04:00
Jacob Young
db76ae8260 x86_64: fix emitting f80 globals 2023-05-01 19:22:52 -04:00
Jacob Young
1fd48815c6 x86_64: cleanup unneeded code 2023-05-01 19:22:52 -04:00
Jacob Young
4ec49da5f6 x86_64: implement a bunch of floating point stuff 2023-05-01 19:22:52 -04:00
Jacob Young
7c9891d7b7 x86_64: use std.log for debug logging 2023-05-01 19:22:52 -04:00
kcbanner
ec6ffaa1e4 sema: improve the error message when coercing to []anyopaque 2023-04-30 16:40:06 -07:00
Andrew Kelley
91b4729962 fix compilation error on 32-bit LLVM-enabled compiler builds
Fixes a regression introduced in
9295355985202c267b4326b5a6e2ad5158b48e5d that caused 32-bit builds with
`-Denable-llvm` to fail to build from source due to that common
u64/usize casting issue.
2023-04-30 12:14:02 -07:00
kcbanner
440b3df702 main: parse --dynamicbase linker arg 2023-04-29 22:19:02 +02:00
Andrew Kelley
c83ab7cc6a
Merge pull request #15503 from r00ster91/noinline
Sema: emit error for always_inline call of noinline function
2023-04-29 11:13:51 -07:00
Andrew Kelley
7baf0de807
Merge pull request #15458 from koachan/sparc64-codegen
stage2: sparc64: Yet another patchset for the selfhosted backend
2023-04-29 10:55:50 -07:00
Loris Cro
13aaa16ab2
Merge pull request #15478 from der-teufel-programming/autodoc-decltests
autodoc: Gather and display decltests
2023-04-29 18:23:18 +02:00
r00ster91
dff6efe369 Sema: disallow indexing non-tuple struct
Fixes #15497
2023-04-29 14:28:36 +03:00
r00ster91
bd8b5c25ec Sema: emit error for always_inline call of noinline function
Fixes #15489

This also lays the groundwork for exposing the whether or not a function is
noinline in std.builtin.Fn as an `is_noinline: bool` field if we ever want to do that.
2023-04-29 04:19:58 +02:00
Koakuma
ccc9b8caf6 stage2: sparc64: Implement airPtrSliceLenPtr/airPtrSlicePtrPtr stubs 2023-04-28 16:46:04 -07:00
Koakuma
75a1360cdd stage2: sparc64: Implement ASI load/store ops 2023-04-28 16:46:04 -07:00
Koakuma
83e6223192 stage2: sparc64: Implement airByteSwap 2023-04-28 16:46:04 -07:00
Koakuma
486ab3852e stage2: sparc64: Factor machine offset calculation 2023-04-28 16:46:04 -07:00
Koakuma
cc2a5185d6 stage2: sparc64: Implement airStructFieldPtr 2023-04-28 16:46:03 -07:00
Koakuma
1794a45572 stage2: sparc64: Add stub for c_va_* 2023-04-28 16:45:37 -07:00
Krzysztof Wolicki
aa51a5c557 autodoc: Gather and display decltests 2023-04-29 00:54:23 +02:00
Andrew Kelley
fee318c44d Sema: fix airMemset for comptime slices 2023-04-28 13:24:43 -07:00
Andrew Kelley
6931f6c5be Sema: fix false negative Value.isComptimePtr for slices 2023-04-28 13:24:43 -07:00
Andrew Kelley
cb9e8b0d01 C backend: take advantage of Assignment abstraction in airMemset 2023-04-28 13:24:43 -07:00
Andrew Kelley
42973d73e6 compiler: use @memcpy instead of std.mem.copy 2023-04-28 13:24:43 -07:00
Andrew Kelley
73d3fb9883 C backend: fix ptr comparison of array ptrs when one is null-terminated 2023-04-28 13:24:43 -07:00
Andrew Kelley
6261c13731 update codebase to use @memset and @memcpy 2023-04-28 13:24:43 -07:00
Andrew Kelley
82fc360613 stage2: avoid panicking for unimplemented compiler code
Prevents the compiler from crashing when using `@memset` on extern
unions, for example.
2023-04-28 13:24:43 -07:00
Andrew Kelley
36df2a83fc C backend: fix memset for structs and arrays 2023-04-28 13:24:42 -07:00
Andrew Kelley
9295355985 LLVM backend: optimize memset with comptime-known element
When the element is comptime-known, we can check if it has a repeated
byte representation. In this case, `@memset` can be lowered with the
LLVM intrinsic rather than with a loop.
2023-04-28 13:24:42 -07:00
Andrew Kelley
51adbf472b llvm backend: fix memset with byref element value 2023-04-28 13:24:42 -07:00
Andrew Kelley
00b690540e llvm backend: fix lowering of memset
The bitcast of ABI size 1 elements was problematic for some types.
2023-04-28 13:24:42 -07:00
Andrew Kelley
fd6200eda6
Merge pull request #15431 from kcbanner/fix_decl_value_arena
sema: Rework Decl.value_arena to fix another memory corruption issue
2023-04-28 11:43:57 -07:00
Andrew Kelley
011bc59e8a
Merge pull request #15435 from jacobly0/x86_64-frame
x86_64: add frame indices
2023-04-27 15:45:01 -07:00
Andrew Kelley
aa3405aabc
Merge pull request #15474 from Luukdegram/wasm-atomics
wasm: implement atomic instructions
2023-04-27 08:26:35 -07:00
Tw
131b328c10 translate-c: deduplicate global declaration
Fix #15456

Signed-off-by: Tw <weii.tan>
2023-04-27 11:13:16 +03:00
kcbanner
15dafd16e6 sema: add prev to ValueArena to allow freeing previous arenas when new ones are created during re-analysis
In semaDecl, it was possible for a new ArenaAllocators state to replace an existing one that
hadn't been freed yet. Instead of the ref_count (which was made redundant by adding
the allocator parameter to `release`), I now store a pointer to the previous arena, if one exists.

This allows a recursive deinit to happen when the last arena created is destroyed.
2023-04-27 01:11:57 -04:00