maat::env::Function class

Emulated function.

❱   Public types

enum class Type { CALLBACK, IR, RAW }
Different types of emulated functions.

using names_t = std::vector<std::string>
Name of the function (and potential aliases)

❱   Constructors, destructors, conversion operators

Function(const std::string& name, const FunctionCallback& callback)
Create an emulated function from a callback.

Function(const names_t& names, const FunctionCallback& callback)
Create an emulated function from a callback.

Function(const names_t& names, std::shared_ptr<ir::AsmInst> block)
Create an emulated function from an IR block.

Function(const names_t& names, const std::vector<uint8_t>& raw)
Create an emulated function from raw assembly.

❱   Public functions

auto type() const -> Type
Type of emulated function.

auto callback() const -> const FunctionCallback&
Return the function callback if it exists, otherwise raise an exception.

auto ir() const -> const std::shared_ptr<ir::AsmInst>&
Return the function IR block if it exists, otherwise raise an exception.

auto names() const -> const std::vector<std::string>&
Return the name and aliases of the function.

auto name() const -> const std::string&
Return the main name of the function.

auto has_name(const std::string& name) const -> const bool
Return True if function has name 'name'.

❱   Enum documentation

enum class maat::env::Function::Type

Different types of emulated functions.

Enumerators
CALLBACK

Emulated with a native C/C++ callback, or a Python callback.

IR

Emulated with an IR block.

RAW

Defined with raw assembly code.