|
| FunctionBuilder (const char *name) |
|
template<typename Signature , bool SRet = false> |
FunctionBuilder & | addSignature (const Signature *ptr, const char *symbol=nullptr) |
|
template<typename Signature , bool SRet = false> |
FunctionBuilder & | addSignature (const IRFunctionBase::GeneratorCb &cb, const char *symbol=nullptr) |
|
template<typename Signature , bool SRet = false> |
FunctionBuilder & | addSignature (const IRFunctionBase::GeneratorCb &cb, const Signature *ptr, const char *symbol=nullptr) |
|
template<typename Signature , bool SRet = false> |
FunctionBuilder & | addSignature (const IRFunctionBase::GeneratorNativeCb &cb, const char *symbol=nullptr) |
|
template<typename Signature , bool SRet = false> |
FunctionBuilder & | addSignature (const IRFunctionBase::GeneratorNativeCb &cb, const Signature *ptr, const char *symbol=nullptr) |
|
template<typename Signature , bool SRet = false> |
FunctionBuilder & | addSignature (const IRFunctionBase::GeneratorArgumentsCb &cb, const char *symbol=nullptr) |
|
template<typename Signature , bool SRet = false> |
FunctionBuilder & | addSignature (const IRFunctionBase::GeneratorArgumentsCb &cb, const Signature *ptr, const char *symbol=nullptr) |
|
FunctionBuilder & | addDependency (const char *name) |
|
FunctionBuilder & | setEmbedIR (bool on) |
|
FunctionBuilder & | setConstantFold (bool on) |
|
FunctionBuilder & | setArgumentNames (const std::vector< const char * > &names) |
|
FunctionBuilder & | addParameterAttribute (const size_t idx, const llvm::Attribute::AttrKind attr) |
| Parameter and Function Attributes. When designing a C binding, llvm will be unable to assign parameter markings to the return type, function body or parameter attributes due to there not being any visibility on the function itself during codegen. The best way to ensure performant C bindings is to ensure that the function is marked with the required llvm parameters. More...
|
|
FunctionBuilder & | addReturnAttribute (const llvm::Attribute::AttrKind attr) |
|
FunctionBuilder & | addFunctionAttribute (const llvm::Attribute::AttrKind attr) |
|
FunctionBuilder & | setReadOnly (const bool on) |
| Mark functions currently sharing settings with as "readonly". This enables the strictest possible memory effects for this function in llvm and implies that the function does not write to any memory (i.e. CreateStore) and only reads memory directly from its function arguments (i.e. nothing external to the function). Functions marked as "readonly" but do not adhere to the above will cause UB. More...
|
|
FunctionBuilder & | setBuiltin (const bool on) |
| Mark functions currently sharing settings as builtin AX methods. At compile time, this causes the IR function body, arguments and return value to be marked with a set of default attributes that apply to all builtin methods, as they are expected to only be called by AX programs. Currently this results in: More...
|
|
FunctionBuilder & | setDocumentation (const char *doc) |
|
FunctionBuilder & | setPreferredImpl (DeclPreferrence pref) |
|
FunctionGroup::UniquePtr | get () const |
|
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.
Use the FunctionBuilder::addSignature methods to append function signatures. Finalize the group of functions with FunctionBuilder::get.
Mark functions currently sharing settings as builtin AX methods. At compile time, this causes the IR function body, arguments and return value to be marked with a set of default attributes that apply to all builtin methods, as they are expected to only be called by AX programs. Currently this results in:
Function Attributes: llvm::Attribute::NoFree llvm::Attribute::WillReturn llvm::Attribute::NoRecurse llvm::Attribute::NoUnwind llvm::Attribute::AlwaysInline Return Attributes: - Parameter Attributes (Ptrs): llvm::Attribute::NonNull llvm::Attribute::NoUndef llvm::Attribute::NoFree
- Warning
- Attributes in this method may be extended - as such, you should mark external function with individual attributes instead of calling this.