OpenVDB 11.0.0
|
Represents a concrete IR function with the first argument as its return type. More...
#include <openvdb_ax/codegen/FunctionTypes.h>
Public Types | |
using | BaseT = SRetFunction<SignatureT, IRFunction<SignatureT>> |
using | Ptr |
using | Traits |
using | GeneratorCb |
The IR callback function which will write the LLVM IR for this function's body. | |
enum | SignatureMatch { None = 0 , Size , Implicit , Explicit } |
The result type from calls to Function::match. More... | |
Public Member Functions | |
IRFunctionSRet (const std::string &symbol, const IRFunctionBase::GeneratorCb &gen) | |
~IRFunctionSRet () override=default | |
Function::SignatureMatch | match (const std::vector< llvm::Type * > &args, llvm::LLVMContext &C) const override |
Override of match which inserts the SRET type such that the base class methods ignore it. | |
llvm::Value * | call (const std::vector< llvm::Value * > &args, llvm::IRBuilder<> &B, const bool cast) const override |
Override of call which allocates the required SRET llvm::Value for this function. | |
void | print (llvm::LLVMContext &C, std::ostream &os, const char *name=nullptr, const bool axTypes=true) const override |
Override of print to avoid printing out the SRET type. | |
llvm::Type * | types (std::vector< llvm::Type * > &types, llvm::LLVMContext &C) const override |
Populate a vector of llvm::Types which describe this function signature. This method is used by Function::create, Function::print and Function::match. | |
void | setEmbedIR (bool on) |
Enable or disable the embedding of IR. Embedded IR is currently required for function which use parent function parameters. | |
bool | hasEmbedIR () const |
llvm::Function * | create (llvm::LLVMContext &C, llvm::Module *M) const override |
Override for the creation of an IR function. This ensures that the body and prototype of the function are generated if a Module is provided. | |
llvm::Function * | create (llvm::Module &M) const |
Convenience method which always uses the provided module to find the function or insert it if necessary. | |
llvm::Function * | get (const llvm::Module &M) const |
Convenience method for calling M.getFunction(symbol). Returns a nullptr if the function has not yet been created or if it is embedded IR. | |
size_t | size () const |
The number of arguments that this function has. | |
const char * | symbol () const |
The function symbol name. | |
const char * | argName (const size_t idx) const |
Returns the descriptive name of the given argument index. | |
bool | hasParamAttribute (const size_t i, const llvm::Attribute::AttrKind &kind) const |
Builder methods. | |
void | setArgumentNames (std::vector< const char * > names) |
const std::vector< const char * > & | dependencies () const |
void | setDependencies (std::vector< const char * > deps) |
void | setFnAttributes (const std::vector< llvm::Attribute::AttrKind > &in) |
void | setRetAttributes (const std::vector< llvm::Attribute::AttrKind > &in) |
void | setParamAttributes (const size_t i, const std::vector< llvm::Attribute::AttrKind > &in) |
Protected Member Functions | |
void | verifyResultType (const llvm::Type *result, const llvm::Type *expected) const |
Static Protected Member Functions | |
static void | cast (std::vector< llvm::Value * > &args, const std::vector< llvm::Type * > &types, llvm::IRBuilder<> &B) |
Cast the provided arguments to the given type as supported by implicit casting of function types. If the types already match OR if a cast cannot be performed, nothing is done to the argument. | |
Protected Attributes | |
const GeneratorCb | mGen |
bool | mEmbedIR |
Represents a concrete IR function with the first argument as its return type.
using BaseT = SRetFunction<SignatureT, IRFunction<SignatureT>> |
|
inherited |
The IR callback function which will write the LLVM IR for this function's body.
The first argument is the vector of functional arguments. i.e. a representation of the value that the callback has been invoked with. The last argument is the IR builder which should be used to generate the function body IR.
|
inherited |
The result type from calls to Function::match.
Enumerator | |
---|---|
None | |
Size | |
Implicit | |
Explicit |
|
inline |
|
overridedefault |
Returns the descriptive name of the given argument index.
If the index is greater than the number of arguments, an empty string is returned.
idx | The index of the argument |
|
inlineoverridevirtualinherited |
Override of call which allocates the required SRET llvm::Value for this function.
Reimplemented from IRFunctionBase.
|
staticprotectedinherited |
Cast the provided arguments to the given type as supported by implicit casting of function types. If the types already match OR if a cast cannot be performed, nothing is done to the argument.
|
overridevirtualinherited |
Override for the creation of an IR function. This ensures that the body and prototype of the function are generated if a Module is provided.
Reimplemented from Function.
|
inlineinherited |
Convenience method which always uses the provided module to find the function or insert it if necessary.
M | The llvm::Module to use |
|
inherited |
Convenience method for calling M.getFunction(symbol). Returns a nullptr if the function has not yet been created or if it is embedded IR.
M | The llvm::Module to use |
|
inlineinherited |
|
inlineinherited |
Builder methods.
|
inlineoverridevirtualinherited |
Override of match which inserts the SRET type such that the base class methods ignore it.
Reimplemented from Function.
|
inlineoverridevirtualinherited |
Override of print to avoid printing out the SRET type.
Reimplemented from Function.
Enable or disable the embedding of IR. Embedded IR is currently required for function which use parent function parameters.
|
inlineinherited |
|
inlineinherited |
The number of arguments that this function has.
The function symbol name.
This will be used as its identifier in IR and must be unique.
|
inlineoverridevirtualinherited |
Populate a vector of llvm::Types which describe this function signature. This method is used by Function::create, Function::print and Function::match.
Implements Function.
|
inlineprotectedinherited |
|
protectedinherited |
|
protectedinherited |