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...
#include <openvdb_ax/codegen/FunctionTypes.h>
|
| ArgInfo | types (ArgInfoVector &args, llvm::LLVMContext &C) const override |
| | Overide the ArgInfo type method. This does NOT change the arg order, it simply marks the first argument as a return argument. Note that the void ret type is also left as a return type.
|
| Function::SignatureMatch | match (const ArgInfoVector &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 override |
| | Override of call which allocates the required SRET llvm::Value for this function.
|
| Value | call (const Arguments &args, llvm::IRBuilder<> &B) const override |
| 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.
|
| Function::SignatureMatch | match (const std::vector< llvm::Type * > &args, llvm::LLVMContext &C) const override |
| llvm::Value * | call (const std::vector< llvm::Value * > &args, llvm::IRBuilder<> &B, const bool cast) const override |
| virtual llvm::Type * | types (std::vector< llvm::Type * > &, llvm::LLVMContext &) const=0 |
|
| template<typename ... Args> |
| | SRetFunction (Args &&... ts) |
| | Forward all arguments to the derived class.
|
template<typename SignatureT, typename DerivedFunction>
struct openvdb::v12_1::ax::codegen::SRetFunction< SignatureT, DerivedFunction >
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.
- Note
- This class is not intended to be instantiated directly, but instead used by derived implementation which hold a valid implementations of member functions required to create a llvm::Function (such as Function::types and Function::call). This exists as an interface to avoid virtual inheritance.
◆ Ptr
template<typename SignatureT, typename DerivedFunction>
◆ Traits
template<typename SignatureT, typename DerivedFunction>
◆ SRetFunction()
template<typename SignatureT, typename DerivedFunction>
template<typename ... Args>
Forward all arguments to the derived class.
◆ call() [1/3]
template<typename SignatureT, typename DerivedFunction>
◆ call() [2/3]
template<typename SignatureT, typename DerivedFunction>
| llvm::Value * call |
( |
const std::vector< llvm::Value * > & | args, |
|
|
llvm::IRBuilder<> & | B ) const |
|
inlineoverride |
Override of call which allocates the required SRET llvm::Value for this function.
- Note
- Unlike other function where the returned llvm::Value* is a llvm::CallInst (which also represents the return value), SRET functions return the allocated 1st argument i.e. not a llvm::CallInst
◆ call() [3/3]
template<typename SignatureT, typename DerivedFunction>
| llvm::Value * call |
( |
const std::vector< llvm::Value * > & | args, |
|
|
llvm::IRBuilder<> & | B, |
|
|
const bool | cast ) const |
|
inlineoverride |
- Note
- This is deprecated! Omitting the warning as it invokes the parent function which is also deprecated. Use NativeArguments to perform argument casting
◆ match() [1/2]
template<typename SignatureT, typename DerivedFunction>
Override of match which inserts the SRET type such that the base class methods ignore it.
◆ match() [2/2]
template<typename SignatureT, typename DerivedFunction>
- Note
- This is deprecated! Omitting the warning as it invokes the parent function which is also deprecated. Use NativeArguments to perform argument casting
◆ print()
template<typename SignatureT, typename DerivedFunction>
| void print |
( |
llvm::LLVMContext & | C, |
|
|
std::ostream & | os, |
|
|
const char * | name = nullptr, |
|
|
const bool | axTypes = true ) const |
|
inlineoverride |
Override of print to avoid printing out the SRET type.
◆ types() [1/2]
template<typename SignatureT, typename DerivedFunction>
Overide the ArgInfo type method. This does NOT change the arg order, it simply marks the first argument as a return argument. Note that the void ret type is also left as a return type.
◆ types() [2/2]
template<typename SignatureT, typename DerivedFunction>
| virtual llvm::Type * types |
( |
std::vector< llvm::Type * > & | , |
|
|
llvm::LLVMContext & | ) const |
- Note
- Bring in deprecated type methods