Commit graph

28475 commits

Author SHA1 Message Date
Jakub Konka
1ca004176f elf+riscv: resolve synthetic __global_pointer$ symbol 2024-02-21 18:09:23 +01:00
antlilja
713a555aa1 LLVM: Remove unused from llvm/bindings.zig and zig_llvm.h/.cpp 2024-02-21 17:54:00 +01:00
antlilja
f6d275b14e LLVM: Remove use of LLVM in Builder 2024-02-21 17:53:15 +01:00
antlilja
626c3f7959 LLVM Builder: Emit debug info and metadata 2024-02-21 16:24:59 +01:00
antlilja
d35080b792 LLVM: Add Metadata/Debug bitcode IR 2024-02-21 16:24:59 +01:00
antlilja
c11c7a28a3 codegen/llvm: Remove use of DIBuilder and output bin by parsing bitcode 2024-02-21 16:24:59 +01:00
antlilja
c16818d623 Add LLVM bindings for parsing LLVM bitcode 2024-02-21 16:24:59 +01:00
antlilja
d3055480ec LLVM: Emit bitcode even if libllvm is not present 2024-02-21 16:24:59 +01:00
antlilja
049cad4411 LLVM Builder: Add debug locations to instructions 2024-02-21 16:24:59 +01:00
antlilja
a456631e29 LLVM Builder: Add debug/metadata system 2024-02-21 16:24:59 +01:00
antlilja
b4369dfbda LLVM: Add toBitcode to Builder 2024-02-21 16:24:59 +01:00
antlilja
5bd2a7c4d6 LLVM IR specific bitcode 2024-02-21 16:24:59 +01:00
antlilja
2396806165 Add LLVM bitcode writer 2024-02-21 16:24:59 +01:00
antlilja
4653fc4bb4 LLVM Builder: Add dbg.declare and dbg.value intrinsics 2024-02-21 16:24:59 +01:00
antlilja
15029590ee LLVM Builder: Add integer values to more enums fields 2024-02-21 16:24:59 +01:00
antlilja
ec5a433fdf Fix FastMath packed struct
* Added missing legacy field (unused_algebra)
* Made struct correct size (u32 -> u8)
2024-02-21 16:24:59 +01:00
antlilja
7cb8813743 Added value_indices and valueIndex to Function
value_indices keeps track of the value index of
each instruction in the function (i.e skips
instruction which do not have a result)
2024-02-21 16:24:59 +01:00
antlilja
423c2c3a27 Made .block = false in WipFunction.hasResultWip 2024-02-21 16:24:59 +01:00
antlilja
c57b4e70b0 Builder: Add function_attributes_set 2024-02-21 16:24:59 +01:00
antlilja
52e8434022 Added opcode functions to Instruction/Constant.Tag 2024-02-21 16:24:59 +01:00
antlilja
ff76ba64d6 Added values to AtomicRmw.Operation enum fields 2024-02-21 16:24:59 +01:00
antlilja
6df8302be6 Fixed values in AtomicOrdering enum 2024-02-21 16:24:59 +01:00
antlilja
fd3b81f93b LLVM Builder: Add toLlvm helper to Alignment 2024-02-21 16:24:59 +01:00
antlilja
2801bf6400 LLVM Builder: Add strtab helper to String 2024-02-21 16:24:59 +01:00
antlilja
9ccd7158b9 LLVM Builder: Make Type.Simple reflect LLVM codes 2024-02-21 16:24:59 +01:00
antlilja
1d94e9ef83 LLVM: Make sure child types get added first
The LLVM bitcode requires all type references in
structs to be to earlier defined types.

We make sure types are ordered in the builder
itself in order to avoid having to iterate the
types multiple times and changing the values
of type indicies.
2024-02-21 16:24:59 +01:00
antlilja
8feae5d2d5 LLVM: Assign correct values to enum/union tags 2024-02-21 16:24:59 +01:00
garrison hinson-hasty
955fd65cb1
Sema: fix peer type resolution for arrays of coercible elements 2024-02-21 00:55:29 +00:00
Jacob Young
ec7293422d llvm: fix c abi for structs not passed in registers
Closes #18916
2024-02-20 23:36:47 +01:00
Jacob Young
2291560424 c_import: extract behavior tests that use @cImport
This introduces the new test step `test-c-import`, and removes the
ability of the behavior tests to `@cImport` paths relative to `test`.
This allows the behavior tests to be run without translate c.
2024-02-20 18:44:43 +01:00
Techatrix
556db2ca36
json: make std.json.stringifyAlloc return a mutable slice (#19013) 2024-02-20 09:03:00 -05:00
mlugg
65a87ff299 Liveness: do not elide safety-checked instructions
Resolves: #19012
2024-02-20 12:10:29 +00:00
Jacob Young
97290e0bfc cbe: make more use of InternPool.Index.Slice
Attempts to fix the current CI failures introduced by #18983.
2024-02-19 19:32:06 -08:00
mlugg
7461309b73 Sema: validate that runtime-known inferred alloc does not have comptime-only type
Resolves: #18997
2024-02-19 21:48:50 +00:00
Ian Johnson
80f3ef6e14 Package.Fetch: fix Git package fetching
This commit works around #18967 by adding an `AccumulatingReader`, which
accumulates data read from the underlying packfile, and by keeping track
of the position in the packfile and hash/checksum information separately
rather than using reader composition. That is, the packfile position and
hashes/checksums are updated with the accumulated read history data only
after we can determine what data has actually been used by the
decompressor rather than merely being buffered.

The only addition to the standard library APIs to support this change is
the `unreadBytes` function in `std.compress.flate.Inflate`, which allows
the user to determine how many bytes have been read only for buffering
and not used as part of compressed data.

These changes can be reverted if #18967 is resolved with a decompressor
that reads precisely only the number of bytes needed for decompression.
2024-02-19 13:43:32 -08:00
Tristan Ross
5c25ad0fda std.zig.system.linux: detect risc-v 2024-02-19 10:12:17 +02:00
Andrew Kelley
7775e46e81
Merge pull request #18983 from jacobly0/dwarf-rewrite
dwarf: optimize dwarf parsing for speed
2024-02-18 12:41:37 -08:00
Jacob Young
247e4ac3cc dwarf: optimize dwarf parsing for speed
This code is run when printing a stack trace in a debug executable, so
it has to be fast even without compiler optimizations.

Adding a `@panic` to the top of `main` and running an x86_64 backend
compiled compiler goes from `1m32.773s` to `0m3.232s`.
2024-02-18 14:11:06 +01:00
Jacob Young
57b2b3df52 Dwarf: use a user tag for padding 2024-02-18 14:11:03 +01:00
Carl Åstholm
3cafb9655a zig fmt: Preserve trailing comma after single-item switch case 2024-02-18 12:36:04 +02:00
Alex Kladov
ab6317d32b std: fix copy-paste typo in spawnWindows 2024-02-17 21:49:00 -08:00
Jakub Konka
f3bd177723
Merge pull request #18976 from ziglang/elf-misc-fixes
elf: misc fixes
2024-02-18 00:43:33 +01:00
Igor Anić
3e8cb153ea fix flate regression
Until now literal and distance code lengths where treated as two
different arrays. But according to rfc they can overlap:

  The code length repeat codes can cross from HLIT + 257 to the
  HDIST + 1 code lengths.  In other words, all code lengths form
  a single sequence of HLIT + HDIST + 258 values.

Now code lengths are decoded in single array which is then split
to literal and distance part.
2024-02-17 15:31:13 -08:00
Jakub Konka
99584906bb elf: fix typo in resolving @"32" and @"32S" relocs on x86_64 2024-02-17 19:39:11 +01:00
Jakub Konka
57e71ce189 elf: @"64" is equivalent to GLOB_DAT on riscv 2024-02-17 19:39:11 +01:00
Jakub Konka
79e99c401c
Merge pull request #18973 from ziglang/elf-riscv
lib/std/elf: refactor relocation types + add RISCV relocs
2024-02-17 19:35:09 +01:00
Robin Voetter
dd4d320eb9
Merge pull request #18948 from alichraghi/vector
spirv: use extended instructions whenever possible
2024-02-17 14:01:07 +01:00
Jakub Konka
d1429a8fa9 lib/std/elf: refactor reloc enum values 2024-02-17 13:13:03 +01:00
Jakub Konka
509c7149b9 elf: fix formatting of relocs when reloc can be Zig specific 2024-02-17 12:35:16 +01:00
Jakub Konka
5fb54736df lib/std/elf: fix typo in R_RISCV_TLSDESC 2024-02-17 12:06:33 +01:00