OpenVDB
12.0.1
|
Namespaces | |
codegen_internal | |
Classes | |
struct | AliasTypeMap |
Alias mapping between two types, a frontend type T1 and a backend type T2. This class is the intended interface for binding objects which implement supported backend AX/IR types to this given backend type. More specifically, it's current and expected usage is limited to objects which hold a single member of a supported backend type and implements a StandardLayoutType as defined by the standard. Fundamentally, T1->T2 mapping should be supported by reinterpret_cast<> as defined by the type aliasing rules. More... | |
struct | ArgType |
Object to array conversion methods to allow functions to return vector types. These containers provided an interface for automatic conversion of C++ objects to LLVM types as array types. More... | |
struct | ArgumentIterator |
Templated argument iterator which implements various small functions per argument type, resolved at compile time. More... | |
struct | ArgumentIterator< SignatureT, 0 > |
struct | CFunction |
Represents a concrete C function binding. More... | |
struct | CFunctionBase |
The base class for all C bindings. More... | |
struct | CFunctionSRet |
Represents a concrete C function binding with the first argument as its return type. More... | |
class | Codec |
struct | ComputeKernel |
The function definition and signature which is built by the ComputeGenerator. More... | |
struct | ConstantFolder |
Constant folding support structure. More... | |
struct | ConstantFolder< SignatureT, 0 > |
struct | Function |
The base/abstract representation of an AX function. Derived classes must implement the Function::types call to describe their signature. More... | |
struct | FunctionBuilder |
The FunctionBuilder class provides a builder pattern framework to allow easy and valid construction of AX functions. There are a number of complex tasks which may need to be performed during construction of C or IR function which are delegated to this builder, whilst ensuring that the constructed functions are guaranteed to be valid. More... | |
struct | FunctionGroup |
todo More... | |
class | FunctionRegistry |
The function registry which is used for function code generation. Each time a function is visited within the AST, its identifier is used as a key into this registry for the corresponding function retrieval and execution. Functions can be inserted into the registry using insert() with a given identifier and pointer. More... | |
struct | FunctionTraits |
Templated function traits which provides compile-time index access to the types of the function signature. More... | |
struct | FunctionTraits< R(&)(Args...)> |
struct | FunctionTraits< R(*)(Args...)> |
struct | FunctionTraits< ReturnT(Args...)> |
struct | int_t |
struct | int_t< 16 > |
struct | int_t< 32 > |
struct | int_t< 64 > |
struct | int_t< 8 > |
struct | IRFunction |
Represents a concrete IR function. More... | |
struct | IRFunctionBase |
The base/abstract definition for an IR function. More... | |
struct | IRFunctionSRet |
Represents a concrete IR function with the first argument as its return type. More... | |
struct | LLVMType |
LLVM type mapping from pod types. More... | |
struct | LLVMType< ArgType< T, S > > |
struct | LLVMType< char > |
struct | LLVMType< codegen::String > |
struct | LLVMType< const T * > |
struct | LLVMType< const T > |
struct | LLVMType< openvdb::math::half > |
struct | LLVMType< openvdb::math::Mat3< T > > |
struct | LLVMType< openvdb::math::Mat4< T > > |
struct | LLVMType< openvdb::math::Vec2< T > > |
Supported aliasing for VDB math types, allowing use in external function signatures. More... | |
struct | LLVMType< openvdb::math::Vec3< T > > |
struct | LLVMType< openvdb::math::Vec4< T > > |
struct | LLVMType< T * > |
struct | LLVMType< T[S]> |
struct | LLVMType< void * > |
struct | LLVMType< void > |
struct | PointKernelAttributeArray |
struct | PointKernelBuffer |
struct | PointKernelBufferRange |
struct | PointKernelValue |
struct | SRetFunction |
Templated interface class for SRET functions. This struct provides the interface for functions that wish to return arrays (vectors or matrices) by internally remapping the first argument for the user. As far as LLVM and any bindings are concerned, the function signature remains unchanged - however the first argument becomes "invisible" to the user and is instead allocated by LLVM before the function is executed. Importantly, the argument has no impact on the user facing AX signature and doesn't affect declaration selection. More... | |
struct | String |
An extremely basic but native representation of a string class with SSO support. This exists to provide an interface between the AX C++ API and backend IR string logic. It is not designed to fulfill any other use and should very rarely be used directly. More... | |
struct | SymbolTable |
A symbol table which can be used to represent a single scoped set of a programs variables. This is simply an unordered map of strings to llvm::Values. More... | |
struct | SymbolTableBlocks |
A map of unique ids to symbol tables which can be used to represent local variables within a program. New scopes can be added and erased where necessary and iterated through using find(). Find assumes that tables are added through parented ascending ids. More... | |
struct | TypeToSymbol |
Type to symbol conversions - these characters are used to build each functions unique signature. They differ from standard AX or LLVM syntax to be as short as possible i.e. vec4d, [4 x double] = d4. More... | |
struct | TypeToSymbol< ArgType< T, S > > |
struct | TypeToSymbol< char > |
struct | TypeToSymbol< codegen::String > |
struct | TypeToSymbol< const T * > |
struct | TypeToSymbol< const T > |
struct | TypeToSymbol< double > |
struct | TypeToSymbol< float > |
struct | TypeToSymbol< int16_t > |
struct | TypeToSymbol< int32_t > |
struct | TypeToSymbol< int64_t > |
struct | TypeToSymbol< int8_t > |
struct | TypeToSymbol< math::Mat3< T > > |
struct | TypeToSymbol< math::Mat4< T > > |
struct | TypeToSymbol< math::Vec2< T > > |
struct | TypeToSymbol< math::Vec3< T > > |
struct | TypeToSymbol< math::Vec4< T > > |
struct | TypeToSymbol< T * > |
struct | TypeToSymbol< T[S]> |
struct | TypeToSymbol< uint16_t > |
struct | TypeToSymbol< uint32_t > |
struct | TypeToSymbol< uint64_t > |
struct | TypeToSymbol< uint8_t > |
struct | TypeToSymbol< void > |
struct | VolumeKernelBuffer |
The second volume kernel, responsible for providing the core layer of SIMD optimisations by invoking this kernel across a range of values. More... | |
struct | VolumeKernelNode |
The third volume kernel, providing an agnostic way to modify a single tile value without passing through the buffer states. Note that this kernel is mainly utility and one of the value kernels should almost always be preferred. More... | |
struct | VolumeKernelValue |
The primary volume kernel. This function holds the generated body of AX programs. More... | |
Typedefs | |
using | CodecNameMap = std::map< const std::string, const Codec * > |
using | CodecTypeMap = std::map< const ast::tokens::CoreType, CodecNameMap > |
using | Codecs = std::vector< const Codec * > |
using | V2D = ArgType< double, 2 > |
using | V2F = ArgType< float, 2 > |
using | V2I = ArgType< int32_t, 2 > |
using | V3D = ArgType< double, 3 > |
using | V3F = ArgType< float, 3 > |
using | V3I = ArgType< int32_t, 3 > |
using | V4D = ArgType< double, 4 > |
using | V4F = ArgType< float, 4 > |
using | V4I = ArgType< int32_t, 4 > |
using | M3D = ArgType< double, 9 > |
using | M3F = ArgType< float, 9 > |
using | M4D = ArgType< double, 16 > |
using | M4F = ArgType< float, 16 > |
using | CastFunction = std::function< llvm::Value *(llvm::IRBuilder<> &, llvm::Value *, llvm::Type *)> |
using | BinaryFunction = std::function< llvm::Value *(llvm::IRBuilder<> &, llvm::Value *, llvm::Value *)> |
Functions | |
OPENVDB_AX_API const CodecTypeMap & | getCodecTypeMap () |
Get the global codec map. More... | |
OPENVDB_AX_API const Codec * | getCodec (const ast::tokens::CoreType type, const std::string &name) |
Get a specific codec. Returns a nullptr if no codec exists. More... | |
OPENVDB_AX_API const CodecNameMap * | getTypeSupportedCodecs (const ast::tokens::CoreType type) |
Get a specific set of codecs which encode a given type. Returns a nullptr if no codec exists. More... | |
FunctionRegistry::UniquePtr | createDefaultRegistry (const FunctionOptions *op=nullptr) |
Creates a registry with the default set of registered functions including math functions, point functions and volume functions. More... | |
OPENVDB_AX_API void | insertStandardFunctions (FunctionRegistry ®, const FunctionOptions *options=nullptr) |
Populates a function registry with all available "standard" AX library function. This primarily consists of all mathematical ops on AX containers (scalars, vectors, matrices) and other stl built-ins. More... | |
OPENVDB_AX_API void | insertVDBPointFunctions (FunctionRegistry ®, const FunctionOptions *options=nullptr) |
Populates a function registry with all available OpenVDB Point AX library function. More... | |
OPENVDB_AX_API void | insertVDBVolumeFunctions (FunctionRegistry ®, const FunctionOptions *options=nullptr) |
Populates a function registry with all available OpenVDB Volume AX library function. More... | |
template<typename SignatureT > | |
llvm::Type * | llvmTypesFromSignature (llvm::LLVMContext &C, std::vector< llvm::Type * > *types=nullptr) |
Populate a vector of llvm types from a function signature declaration. More... | |
template<typename SignatureT > | |
llvm::FunctionType * | llvmFunctionTypeFromSignature (llvm::LLVMContext &C) |
Generate an LLVM FunctionType from a function signature. More... | |
OPENVDB_AX_API void | printSignature (std::ostream &os, const std::vector< llvm::Type * > &types, const llvm::Type *returnType, const char *name=nullptr, const std::vector< const char * > &names={}, const bool axTypes=false) |
Print a function signature to the provided ostream. More... | |
template<typename T > | |
llvm::Constant * | llvmConstant (const T t, llvm::Type *type) |
Returns an llvm Constant holding a scalar value. More... | |
OPENVDB_AX_API llvm::IntegerType * | llvmIntType (const uint32_t size, llvm::LLVMContext &C) |
Returns an llvm IntegerType given a requested size and context. More... | |
OPENVDB_AX_API llvm::Type * | llvmFloatType (const uint32_t size, llvm::LLVMContext &C) |
Returns an llvm floating point Type given a requested size and context. More... | |
OPENVDB_AX_API llvm::Type * | llvmTypeFromToken (const ast::tokens::CoreType &type, llvm::LLVMContext &C) |
Returns an llvm type representing a type defined by a string. More... | |
OPENVDB_AX_API ast::tokens::CoreType | tokenFromLLVMType (const llvm::Type *type) |
Return a corresponding AX token which represents the given LLVM Type. More... | |
auto | ir_load (llvm::IRBuilder<> &B, llvm::Value *ptr, const char *Name="") |
Alias around IR load inst. More... | |
auto | ir_gep (llvm::IRBuilder<> &B, llvm::Value *ptr, llvm::ArrayRef< llvm::Value * > IdxList, const char *Name="") |
Alias around IR gep inst. More... | |
auto | ir_constgep2_64 (llvm::IRBuilder<> &B, llvm::Value *ptr, uint64_t Idx0, uint64_t Idx1, const char *Name="") |
Alias around IR gep2_64 inst. More... | |
auto | ir_constinboundsgep2_64 (llvm::IRBuilder<> &B, llvm::Value *ptr, uint64_t Idx0, uint64_t Idx1, const char *Name="") |
Alias around IR in bounds gep2_64 inst. More... | |
void | valuesToTypes (const std::vector< llvm::Value * > &values, std::vector< llvm::Type * > &types) |
Populate a vector of llvm Types from a vector of llvm values. More... | |
void | llvmTypeToString (const llvm::Type *const type, std::string &str) |
Prints an llvm type to a std string. More... | |
llvm::Type * | getBaseContainedType (llvm::Type *const type) |
Return the base llvm value which is being pointed to through any number of layered pointers. More... | |
template<typename ValueT > | |
llvm::Value * | llvmPointerFromAddress (const ValueT *const &ptr, llvm::IRBuilder<> &builder) |
Return an llvm value representing a pointer to the provided ptr builtin ValueT. More... | |
llvm::Value * | insertStaticAlloca (llvm::IRBuilder<> &B, llvm::Type *type, llvm::Value *size=nullptr) |
Insert a stack allocation at the beginning of the current function of the provided type and size. The IRBuilder's insertion point must be set to a BasicBlock with a valid Function parent. More... | |
llvm::Argument * | extractArgument (llvm::Function *F, const size_t idx) |
llvm::Argument * | extractArgument (llvm::Function *F, const std::string &name) |
llvm::Type * | typePrecedence (llvm::Type *const typeA, llvm::Type *const typeB) |
Returns the highest order type from two LLVM Scalar types. More... | |
CastFunction | llvmArithmeticConversion (const llvm::Type *const sourceType, const llvm::Type *const targetType, const std::string &twine="") |
Returns a CastFunction which represents the corresponding instruction to convert a source llvm Type to a target llvm Type. If the conversion is unsupported, throws an error. More... | |
BinaryFunction | llvmBinaryConversion (const llvm::Type *const type, const ast::tokens::OperatorToken &token, const std::string &twine="") |
Returns a BinaryFunction representing the corresponding instruction to perform on two scalar values, relative to a provided operator token. Note that not all operations are supported on floating point types! If the token is not supported, or the llvm type is not a scalar type, throws an error. More... | |
bool | isValidCast (llvm::Type *from, llvm::Type *to) |
Returns true if the llvm Type 'from' can be safely cast to the llvm Type 'to'. More... | |
llvm::Value * | arithmeticConversion (llvm::Value *value, llvm::Type *targetType, llvm::IRBuilder<> &builder) |
Casts a scalar llvm Value to a target scalar llvm Type. Returns the cast scalar value of type targetType. More... | |
llvm::Value * | arrayCast (llvm::Value *ptrToArray, llvm::Type *targetElementType, llvm::IRBuilder<> &builder) |
Casts an array to another array of equal size but of a different element type. Both source and target array element types must be scalar types. The source array llvm Value should be a pointer to the array to cast. More... | |
void | arithmeticConversion (std::vector< llvm::Value * > &values, llvm::Type *targetElementType, llvm::IRBuilder<> &builder) |
Converts a vector of loaded llvm scalar values of the same type to a target scalar type. Each value is converted individually and the loaded result stored in the same location within values. More... | |
void | arithmeticConversion (std::vector< llvm::Value * > &values, llvm::IRBuilder<> &builder) |
Converts a vector of loaded llvm scalar values to the highest precision type stored amongst them. Any values which are not scalar types are ignored. More... | |
void | arithmeticConversion (llvm::Value *&valueA, llvm::Value *&valueB, llvm::IRBuilder<> &builder) |
Chooses the highest order llvm Type as defined by typePrecedence from either of the two incoming values and casts the other value to the choosen type if it is not already. The types of valueA and valueB are guaranteed to match. Both values must be scalar LLVM types. More... | |
llvm::Value * | boolComparison (llvm::Value *value, llvm::IRBuilder<> &builder) |
Performs a C style boolean comparison from a given scalar LLVM value. More... | |
llvm::Value * | binaryOperator (llvm::Value *lhs, llvm::Value *rhs, const ast::tokens::OperatorToken &token, llvm::IRBuilder<> &builder) |
llvm::Value * | arrayIndexUnpack (llvm::Value *ptrToArray, const int16_t index, llvm::IRBuilder<> &builder) |
Unpack a particular element of an array and return a pointer to that element The provided llvm Value is expected to be a pointer to an array. More... | |
void | arrayUnpack (llvm::Value *ptrToArray, std::vector< llvm::Value * > &values, llvm::IRBuilder<> &builder, const bool loadElements=false) |
Unpack an array type into llvm Values which represent all its elements The provided llvm Value is expected to be a pointer to an array If loadElements is true, values will store loaded llvm values instead of pointers to the array elements. More... | |
void | array3Unpack (llvm::Value *ptrToArray, llvm::Value *&value1, llvm::Value *&value2, llvm::Value *&value3, llvm::IRBuilder<> &builder) |
Unpack the first three elements of an array. The provided llvm Value is expected to be a pointer to an array. More... | |
llvm::Value * | array3Pack (llvm::Value *value1, llvm::Value *value2, llvm::Value *value3, llvm::IRBuilder<> &builder) |
Pack three values into a new array and return a pointer to the newly allocated array. If the values are of a mismatching type, the highets order type is uses, as defined by typePrecedence. All llvm values are expected to a be a loaded scalar type. More... | |
llvm::Value * | arrayPack (llvm::Value *value, llvm::IRBuilder<> &builder, const size_t size=3) |
Pack a loaded llvm scalar value into a new array of a specified size and return a pointer to the newly allocated array. Each element of the new array will have the value of the given scalar. More... | |
llvm::Value * | arrayPack (const std::vector< llvm::Value * > &values, llvm::IRBuilder<> &builder) |
Pack a vector of loaded llvm scalar values into a new array of equal size and return a pointer to the newly allocated array. More... | |
llvm::Value * | arrayPackCast (std::vector< llvm::Value * > &values, llvm::IRBuilder<> &builder) |
Pack a vector of loaded llvm scalar values into a new array of equal size and return a pointer to the newly allocated array. arrayPackCast first checks all the contained types in values and casts all types to the highest order type present. All llvm values in values are expected to be loaded scalar types. More... | |
llvm::Value * | scalarToMatrix (llvm::Value *scalar, llvm::IRBuilder<> &builder, const size_t dim=3) |
using BinaryFunction = std::function<llvm::Value* (llvm::IRBuilder<>&, llvm::Value*, llvm::Value*)> |
using CastFunction = std::function<llvm::Value* (llvm::IRBuilder<>&, llvm::Value*, llvm::Type*)> |
using CodecNameMap = std::map<const std::string, const Codec*> |
using CodecTypeMap = std::map<const ast::tokens::CoreType, CodecNameMap> |
|
inline |
Casts a scalar llvm Value to a target scalar llvm Type. Returns the cast scalar value of type targetType.
value | A llvm scalar value to convert |
targetType | The target llvm scalar type to convert to |
builder | The current llvm IRBuilder |
|
inline |
Converts a vector of loaded llvm scalar values of the same type to a target scalar type. Each value is converted individually and the loaded result stored in the same location within values.
values | A vector of llvm scalar values to convert |
targetElementType | The target llvm scalar type to convert each value of the input vector |
builder | The current llvm IRBuilder |
|
inline |
Converts a vector of loaded llvm scalar values to the highest precision type stored amongst them. Any values which are not scalar types are ignored.
values | A vector of llvm scalar values to convert |
builder | The current llvm IRBuilder |
|
inline |
Chooses the highest order llvm Type as defined by typePrecedence from either of the two incoming values and casts the other value to the choosen type if it is not already. The types of valueA and valueB are guaranteed to match. Both values must be scalar LLVM types.
valueA | The first llvm value |
valueB | The second llvm value |
builder | The current llvm IRBuilder |
|
inline |
Pack three values into a new array and return a pointer to the newly allocated array. If the values are of a mismatching type, the highets order type is uses, as defined by typePrecedence. All llvm values are expected to a be a loaded scalar type.
value1 | The first array value |
value2 | The second array value |
value3 | The third array value |
builder | The current llvm IRBuilder |
|
inline |
Unpack the first three elements of an array. The provided llvm Value is expected to be a pointer to an array.
ptrToArray | A llvm value which is a pointer to a llvm array |
value1 | The first array value |
value2 | The second array value |
value3 | The third array value |
builder | The current llvm IRBuilder |
|
inline |
Casts an array to another array of equal size but of a different element type. Both source and target array element types must be scalar types. The source array llvm Value should be a pointer to the array to cast.
ptrToArray | A llvm value which is a pointer to a llvm array |
targetElementType | The target llvm scalar type to convert each element of the input array |
builder | The current llvm IRBuilder |
|
inline |
Unpack a particular element of an array and return a pointer to that element The provided llvm Value is expected to be a pointer to an array.
ptrToArray | A llvm value which is a pointer to a llvm array |
index | The index at which to access the array |
builder | The current llvm IRBuilder |
|
inline |
Pack a loaded llvm scalar value into a new array of a specified size and return a pointer to the newly allocated array. Each element of the new array will have the value of the given scalar.
value | The uniform scalar llvm value to pack into the array |
builder | The current llvm IRBuilder |
size | The size of the newly allocated array |
|
inline |
Pack a vector of loaded llvm scalar values into a new array of equal size and return a pointer to the newly allocated array.
values | A vector of loaded llvm scalar values to pack |
builder | The current llvm IRBuilder |
|
inline |
Pack a vector of loaded llvm scalar values into a new array of equal size and return a pointer to the newly allocated array. arrayPackCast first checks all the contained types in values and casts all types to the highest order type present. All llvm values in values are expected to be loaded scalar types.
values | A vector of loaded llvm scalar values to pack |
builder | The current llvm IRBuilder |
|
inline |
Unpack an array type into llvm Values which represent all its elements The provided llvm Value is expected to be a pointer to an array If loadElements is true, values will store loaded llvm values instead of pointers to the array elements.
ptrToArray | A llvm value which is a pointer to a llvm array |
values | A vector of llvm values where to store the array elements |
builder | The current llvm IRBuilder |
loadElements | Whether or not to load each array element into a register |
|
inline |
@ brief Performs a binary operation on two loaded llvm scalar values of the same type. The type of operation performed is defined by the token (see the list of supported tokens in ast/Tokens.h. Returns a loaded llvm scalar result
lhs | The left hand side value of the binary operation |
rhs | The right hand side value of the binary operation |
token | The token representing the binary operation to perform |
builder | The current llvm IRBuilder |
|
inline |
Performs a C style boolean comparison from a given scalar LLVM value.
value | The scalar llvm value to convert to a boolean |
builder | The current llvm IRBuilder |
|
inline |
Creates a registry with the default set of registered functions including math functions, point functions and volume functions.
op | The current function options |
|
inline |
|
inline |
|
inline |
Return the base llvm value which is being pointed to through any number of layered pointers.
type | A llvm pointer type to traverse |
OPENVDB_AX_API const Codec* openvdb::v12_0::ax::codegen::getCodec | ( | const ast::tokens::CoreType | type, |
const std::string & | name | ||
) |
Get a specific codec. Returns a nullptr if no codec exists.
type | The type the codec encodes |
name | The name of the codec |
OPENVDB_AX_API const CodecTypeMap& openvdb::v12_0::ax::codegen::getCodecTypeMap | ( | ) |
Get the global codec map.
OPENVDB_AX_API const CodecNameMap* openvdb::v12_0::ax::codegen::getTypeSupportedCodecs | ( | const ast::tokens::CoreType | type | ) |
Get a specific set of codecs which encode a given type. Returns a nullptr if no codec exists.
type | The type the codecs encode |
OPENVDB_AX_API void openvdb::v12_0::ax::codegen::insertStandardFunctions | ( | FunctionRegistry & | reg, |
const FunctionOptions * | options = nullptr |
||
) |
Populates a function registry with all available "standard" AX library function. This primarily consists of all mathematical ops on AX containers (scalars, vectors, matrices) and other stl built-ins.
reg | The function registry to populate |
options | The current function options |
|
inline |
Insert a stack allocation at the beginning of the current function of the provided type and size. The IRBuilder's insertion point must be set to a BasicBlock with a valid Function parent.
B | The IRBuilder |
type | The type to allocate |
size | Optional count of allocations. If nullptr, runs a single allocation |
OPENVDB_AX_API void openvdb::v12_0::ax::codegen::insertVDBPointFunctions | ( | FunctionRegistry & | reg, |
const FunctionOptions * | options = nullptr |
||
) |
Populates a function registry with all available OpenVDB Point AX library function.
reg | The function registry to populate |
options | The current function options |
OPENVDB_AX_API void openvdb::v12_0::ax::codegen::insertVDBVolumeFunctions | ( | FunctionRegistry & | reg, |
const FunctionOptions * | options = nullptr |
||
) |
Populates a function registry with all available OpenVDB Volume AX library function.
reg | The function registry to populate |
options | The current function options |
|
inline |
Alias around IR gep2_64 inst.
|
inline |
Alias around IR in bounds gep2_64 inst.
|
inline |
Alias around IR gep inst.
|
inline |
Alias around IR load inst.
|
inline |
Returns true if the llvm Type 'from' can be safely cast to the llvm Type 'to'.
|
inline |
Returns a CastFunction which represents the corresponding instruction to convert a source llvm Type to a target llvm Type. If the conversion is unsupported, throws an error.
sourceType | The source type to cast |
targetType | The target type to cast to |
twine | An optional string description of the cast function. This can be used for for more verbose llvm information on IR compilation failure |
|
inline |
Returns a BinaryFunction representing the corresponding instruction to perform on two scalar values, relative to a provided operator token. Note that not all operations are supported on floating point types! If the token is not supported, or the llvm type is not a scalar type, throws an error.
type | The type defining the precision of the binary operation |
token | The token used to create the relative binary operation |
twine | An optional string description of the binary function. This can be used for for more verbose llvm information on IR compilation failure |
|
inline |
Returns an llvm Constant holding a scalar value.
t | The scalar constant |
type | The LLVM type. Can differ from the type of t, in which case the value will be cast to the llvm type |
OPENVDB_AX_API llvm::Type* openvdb::v12_0::ax::codegen::llvmFloatType | ( | const uint32_t | size, |
llvm::LLVMContext & | C | ||
) |
Returns an llvm floating point Type given a requested size and context.
size | The size of the float to request, i.e. float - 32, double - 64 etc. |
C | The LLVMContext to request the Type from. |
|
inline |
Generate an LLVM FunctionType from a function signature.
C | The llvm context |
OPENVDB_AX_API llvm::IntegerType* openvdb::v12_0::ax::codegen::llvmIntType | ( | const uint32_t | size, |
llvm::LLVMContext & | C | ||
) |
Returns an llvm IntegerType given a requested size and context.
size | The number of bits of the integer type |
C | The LLVMContext to request the Type from. |
|
inline |
Return an llvm value representing a pointer to the provided ptr builtin ValueT.
ptr | A pointer to a type of ValueT whose address will be computed and returned |
builder | The current llvm IRBuilder |
OPENVDB_AX_API llvm::Type* openvdb::v12_0::ax::codegen::llvmTypeFromToken | ( | const ast::tokens::CoreType & | type, |
llvm::LLVMContext & | C | ||
) |
Returns an llvm type representing a type defined by a string.
type | The AX token type |
C | The LLVMContext to request the Type from. |
|
inline |
Populate a vector of llvm types from a function signature declaration.
C | The llvm context |
types | A vector of types to populate |
|
inline |
Prints an llvm type to a std string.
type | The llvm type to convert |
str | The string to store the type info to |
OPENVDB_AX_API void openvdb::v12_0::ax::codegen::printSignature | ( | std::ostream & | os, |
const std::vector< llvm::Type * > & | types, | ||
const llvm::Type * | returnType, | ||
const char * | name = nullptr , |
||
const std::vector< const char * > & | names = {} , |
||
const bool | axTypes = false |
||
) |
Print a function signature to the provided ostream.
os | The stream to print to |
types | The function argument types |
returnType | The return type of the function. Must not be a nullptr |
name | The name of the function. If not provided, the return type neighbours the first parenthesis |
names | Names of the function parameters. If a name is nullptr, it skipped |
axTypes | Whether to try and convert the llvm::Types provided to AX types. If false, the llvm types are used. |
|
inline |
OPENVDB_AX_API ast::tokens::CoreType openvdb::v12_0::ax::codegen::tokenFromLLVMType | ( | const llvm::Type * | type | ) |
Return a corresponding AX token which represents the given LLVM Type.
type | a valid LLVM Type |
|
inline |
Returns the highest order type from two LLVM Scalar types.
typeA | The first scalar llvm type |
typeB | The second scalar llvm type |
|
inline |
Populate a vector of llvm Types from a vector of llvm values.
values | A vector of llvm values to retrieve types from |
types | A vector of llvm types to populate |