Proteus
Programmable JIT compilation and optimization for C/C++ using LLVM
Loading...
Searching...
No Matches
Public Member Functions | List of all members
proteus::Func< RetT, ArgT > Class Template Referencefinal

#include <Func.hpp>

Inheritance diagram for proteus::Func< RetT, ArgT >:
Inheritance graph
[legend]
Collaboration diagram for proteus::Func< RetT, ArgT >:
Collaboration graph
[legend]

Public Member Functions

 Func (JitModule &J, FunctionCallee FC, Dispatcher &Dispatch)
 
RetT operator() (ArgT... Args)
 
auto getArgs ()
 
auto getCompiledFunc () const
 
void setCompiledFunc (RetT(*CompiledFuncIn)(ArgT...))
 
- Public Member Functions inherited from proteus::FuncBase
 FuncBase (JitModule &J, FunctionCallee FC)
 
Function * getFunction ()
 
AllocaInst * emitAlloca (Type *Ty, StringRef Name)
 
IRBuilderBase & getIRBuilder ()
 
VardeclVarInternal (StringRef Name, Type *Ty, Type *PointerElemType=nullptr)
 
template<typename T >
VardeclVar (StringRef Name="var")
 
template<typename T >
VardefVar (T Val, StringRef Name="var")
 
template<typename T >
VardefRuntimeConst (T Val, StringRef Name="run.const.var")
 
template<typename... ArgT>
auto defRuntimeConsts (ArgT &&...Args)
 
template<typename... Ts>
void declArgs ()
 
VargetArg (unsigned int ArgNo)
 
void beginFunction (const char *File=__builtin_FILE(), int Line=__builtin_LINE())
 
void endFunction ()
 
void beginIf (Var &CondVar, const char *File=__builtin_FILE(), int Line=__builtin_LINE())
 
void endIf ()
 
void beginFor (Var &IterVar, Var &InitVar, Var &UpperBound, Var &IncVar, const char *File=__builtin_FILE(), int Line=__builtin_LINE())
 
void endFor ()
 
template<typename RetT , typename... ArgT>
std::enable_if_t<!std::is_void_v< RetT >, Var & > call (StringRef Name)
 
template<typename RetT , typename... ArgT>
std::enable_if_t< std::is_void_v< RetT >, void > call (StringRef Name)
 
VarcallBuiltin (function_ref< Var &(FuncBase &)> Lower)
 
void ret (std::optional< std::reference_wrapper< Var > > OptRet=std::nullopt)
 
StringRef getName () const
 
void setName (StringRef NewName)
 

Additional Inherited Members

- Protected Types inherited from proteus::FuncBase
enum class  ScopeKind { FUNCTION , IF , FOR }
 
- Protected Member Functions inherited from proteus::FuncBase
std::string toString (ScopeKind Kind)
 
- Protected Attributes inherited from proteus::FuncBase
JitModuleJ
 
FunctionCallee FC
 
IRBuilder IRB
 
IRBuilderBase::InsertPoint IP
 
std::deque< VarArguments
 
std::deque< VarVariables
 
std::deque< VarRuntimeConstants
 
std::string Name
 
std::vector< ScopeScopes
 

Constructor & Destructor Documentation

◆ Func()

template<typename RetT , typename... ArgT>
proteus::Func< RetT, ArgT >::Func ( JitModule J,
FunctionCallee  FC,
Dispatcher Dispatch 
)
inline

Member Function Documentation

◆ getArgs()

template<typename RetT , typename... ArgT>
auto proteus::Func< RetT, ArgT >::getArgs ( )
inline

◆ getCompiledFunc()

template<typename RetT , typename... ArgT>
auto proteus::Func< RetT, ArgT >::getCompiledFunc ( ) const
inline

◆ operator()()

template<typename RetT , typename... ArgT>
RetT proteus::Func< RetT, ArgT >::operator() ( ArgT...  Args)

◆ setCompiledFunc()

template<typename RetT , typename... ArgT>
void proteus::Func< RetT, ArgT >::setCompiledFunc ( RetT(*)(ArgT...)  CompiledFuncIn)
inline

The documentation for this class was generated from the following files: