28243 Commits

Author SHA1 Message Date
Jacob Young
f644263a6c Builder: fix llvm ir/bc difference with allocas 2024-02-23 18:17:14 +01:00
Jacob Young
03eb332d3c Builder: fix aliases in bitcode 2024-02-23 18:17:14 +01:00
Jacob Young
7f3ade6dea Builder: fix x86_fp80 constants in bitcode 2024-02-23 09:15:58 +01:00
Jacob Young
800495afab Builder: fix minor llvm ir syntax errors 2024-02-23 07:51:38 +01:00
Jacob Young
6abb432598 Builder: implement opaque structs in bitcode 2024-02-23 07:51:38 +01:00
Jacob Young
43daed64fe Builder: change tuple metadata to not be inlined in llvm ir 2024-02-23 06:18:10 +01:00
Jacob Young
1d4a7e123c llvm: revert bad cleanup 2024-02-23 03:23:49 +01:00
Jacob Young
be4ad235a7 Builder: fix inconsequential llvm ir metadata syntax 2024-02-23 03:23:49 +01:00
Jacob Young
8d0f6605fe Builder: sync distinct bits with previous implementation 2024-02-23 03:23:49 +01:00
antlilja
dfde194287 LLVM Builder: Make some Metadata no longer be distinct 2024-02-23 03:12:54 +01:00
antlilja
0ba2185a42 LLVM Builder: Formatting 2024-02-23 03:12:35 +01:00
Jacob Young
c894df54f7 Builder: fix debug location of the first instruction in a block 2024-02-23 01:45:25 +01:00
Jacob Young
dbfa3238fe Builder: fix float constants in llvm ir 2024-02-22 23:51:53 +01:00
Jacob Young
83e66d301e Builder: fix bitcode strtab 2024-02-22 19:50:41 +01:00
antlilja
2ab982eb13 Revert build.zig to old 7GB value 2024-02-22 19:41:53 +01:00
Jacob Young
69a6f31596 Builder: fix llvm ir value names
Hello world now verifies when not stripped.
2024-02-22 19:10:52 +01:00
antlilja
6cc51d3c33 LLVM: Set new debug location after inlining 2024-02-22 16:07:25 +01:00
antlilja
de536e8473 LLVM Builder: Emit metadata kinds and function metadata attachments 2024-02-22 15:29:28 +01:00
antlilja
92eec8dfec LLVM Builder: Emit type for debug subprogram 2024-02-22 15:24:22 +01:00
Jacob Young
4b215e3a11 Builder: support printing metadata in llvm ir 2024-02-22 08:54:35 +01:00
antlilja
a907353ca4 LLVM Builder: Fix on 32-bit systems 2024-02-22 00:39:56 +01:00
antlilja
53f6071486 LLVM Builder: Emit debug vector types with DIVector flag 2024-02-21 23:33:25 +01:00
antlilja
5e9d0da43b LLVM Builder: Correctly emit debug subranges
The bitcode abbrev was missing the subrange code
2024-02-21 23:32:21 +01:00
antlilja
e57f553c07 LLVM Builder: Rework MetadataString to not rely on String
This fixes a problem where empty strings where not emitted as null.
This should also emit a smaller stringtab as all metadata strings were
emitted in both the strtab and in the strings block inside the metadata
block.
2024-02-21 21:46:04 +01:00
Jacob Young
48bd0ed7f3 llvm: fix builds that don't link with libllvm 2024-02-21 19:18:34 +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