1 # spirv_to_llvm library
3 ## `spirv_to_llvm/spirv_to_llvm.h`
5 ### `spirv_to_llvm::Type_descriptor`
6 Type representing a SPIR-V Type. Does custom type layout instead of letting LLVM layout types to avoid creating types that need a stricter alignment than `::operator new` provides.
8 - `decorations`: the SPIR-V decorations applied to this type.
9 - `get_or_make_type`: returns the LLVM type that `this` translates to, generating it if needed. Also returns the alignment used to store the returned LLVM type.
11 - `Recursion_checker`: helper type used to prevent infinite recursion when generating LLVM types.
12 See `spirv_to_llvm::Struct_type_descriptor::get_or_make_type` to see how to use it.
13 - `Recursion_checker_state`: state used by `Recursion_checker`.
15 ### `spirv_to_llvm::Simple_type_descriptor`
16 Wrap a fundamental type (not based on any other SPIR-V type).
18 ### `spirv_to_llvm::Vector_type_descriptor`
21 ### `spirv_to_llvm::Matrix_type_descriptor`
24 ### `spirv_to_llvm::Array_type_descriptor`
27 ### `spirv_to_llvm::Pointer_type_descriptor`
28 Wrap a pointer type. If `base == nullptr`, then `this` is a forward declaration.
30 ### `spirv_to_llvm::Function_type_descriptor`
33 ### `spirv_to_llvm::Struct_type_descriptor`
35 This can be in one of two states:
36 - Incomplete: The default state upon construction. Members can be added in this state.
37 - Complete: The state transitioned to by calling `get_members(true)` or `get_or_make_type()`. Members can no longer be added.
39 ### `spirv_to_llvm::Constant_descriptor`
42 - `get_or_make_value`: returns the LLVM value that `this` translates to, generating it if needed.
44 ### `spirv_to_llvm::Simple_constant_descriptor`
45 A simple SPIR-V constant. Wraps a LLVM value.
47 ### `spirv_to_llvm::Converted_module`
48 The results of converting a SPIR-V shader from SPIR-V to LLVM IR.
50 ### `spirv_to_llvm::Jit_symbol_resolver`
51 Resolve built-in symbols for the JIT. This is where to add new built-in functions that are called by LLVM IR.
53 ### `spirv_to_llvm::spirv_to_llvm`
54 Convert the provided SPIR-V shader to LLVM IR. Throws `spirv::Parser_error` on error.