OpenVDB 11.0.0

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
FunctionGroup Struct Reference

todo More...

`#include <openvdb_ax/codegen/FunctionTypes.h>`

## Public Types
using | Ptr = std::shared_ptr< FunctionGroup >
using | UniquePtr = std::unique_ptr< FunctionGroup >
using | FunctionList = std::vector< Function::Ptr >

## Public Member Functions
| FunctionGroup (const char *name, const char *doc, const FunctionList &list)
| ~FunctionGroup ()=default
const Function * | match (const std::vector< llvm::Type * > &types, llvm::LLVMContext &C, Function::SignatureMatch *type=nullptr) const
| Given a vector of llvm types, automatically returns the best possible function declaration from the stored function list. The 'best' declaration is determined by the provided types compatibility to each functions signature.
llvm::Value * | execute (const std::vector< llvm::Value * > &args, llvm::IRBuilder<> &B) const
| Given a vector of llvm values, find the best possible function signature, generate and execute the function body. Returns the return value of the function (nullptr if void). The behaviour is undefined if a valid match does not exist. For such cases, call the second version of FunctionGroup::execute.
const Function * | execute (const std::vector< llvm::Value * > &args, llvm::IRBuilder<> &B, llvm::Value *&result) const
| Given a vector of llvm values, find the best possible function signature, generate and execute the function body. Returns the Function that was selected and executed or a nullptr if no valid match was found. Sets the result variable to the return value of the function (nullptr if void). If no match is found, the result variable if left unset.
const FunctionList & | list () const
| Accessor to the underlying function signature list.
const char * | name () const
const char * | doc () const

## Detailed Description

todo

## Member Typedef Documentation

## ◆ FunctionList

using FunctionList = std::vector<Function::Ptr>

## ◆ Ptr

using Ptr = std::shared_ptr<FunctionGroup>

## ◆ UniquePtr

using UniquePtr = std::unique_ptr<FunctionGroup>

## Constructor & Destructor Documentation

## ◆ FunctionGroup()

FunctionGroup | ( | const char * | name,
|  | const char * | doc,
|  | const FunctionList & | list
| ) |  |
| inline

## ◆ ~FunctionGroup()

~FunctionGroup | ( |  | ) |
| default

## Member Function Documentation

## ◆ doc()

const char * doc | ( |  | ) | const
| inline

## ◆ execute() [1/2]

llvm::Value * execute | ( | const std::vector< llvm::Value * > & | args,
|  | llvm::IRBuilder<> & | B
| ) |  | const

Given a vector of llvm values, find the best possible function signature, generate and execute the function body. Returns the return value of the function (nullptr if void). The behaviour is undefined if a valid match does not exist. For such cases, call the second version of FunctionGroup::execute.

Note
  This function will throw if no valid return is provided by the matched declaration implementation.

Parameters

  args | A vector of values representing the function arguments
  B | The current llvm IRBuilder

## ◆ execute() [2/2]

const Function * execute | ( | const std::vector< llvm::Value * > & | args,
|  | llvm::IRBuilder<> & | B,
|  | llvm::Value *& | result
| ) |  | const

Given a vector of llvm values, find the best possible function signature, generate and execute the function body. Returns the Function that was selected and executed or a nullptr if no valid match was found. Sets the result variable to the return value of the function (nullptr if void). If no match is found, the result variable if left unset.

Note
  This function will throw if no valid return is provided by the matched declaration implementation.

Parameters

  args | A vector of values representing the function arguments
  B | The current llvm IRBuilder
  result | The result to set. nullptr on void return.

Returns
  The matched function. nullptr if no match was found

## ◆ list()

const FunctionList & list | ( |  | ) | const
| inline

Accessor to the underlying function signature list.

## ◆ match()

const Function * match | ( | const std::vector< llvm::Type * > & | types,
|  | llvm::LLVMContext & | C,
|  | Function::SignatureMatch * | type = `nullptr`
| ) |  | const

Given a vector of llvm types, automatically returns the best possible function declaration from the stored function list. The 'best' declaration is determined by the provided types compatibility to each functions signature.

Note
  If multiple implicit matches are found, the first match is returned.
  Returns a nullptr if no compatible match was found or if the function list is empty. A compatible match is defined as an Explicit or Implicit match.

Parameters

  types | A vector of types representing the function argument types
  C | The llvm context
  type | If provided, type is set to the type of match that occurred

## ◆ name()

const char * name | ( |  | ) | const
| inline