7 #ifndef RETDEC_LLVMIR2HLL_IR_FUNCTION_TYPE_H
8 #define RETDEC_LLVMIR2HLL_IR_FUNCTION_TYPE_H
30 using Params = std::vector<ShPtr<Type>>;
A representation of a function type.
Definition: function_type.h:27
std::size_t getNumOfParams() const
Returns the number of parameters.
Definition: function_type.cpp:107
virtual void accept(Visitor *v) override
Visitor pattern implementation.
Definition: function_type.cpp:172
bool varArg
Takes the function a variable number of arguments?
Definition: function_type.h:84
ShPtr< Type > getRetType() const
Returns the return type.
Definition: function_type.cpp:77
bool hasParam(std::size_t n) const
Returns true if there is an n-th parameter, false otherwise.
Definition: function_type.cpp:97
static ShPtr< FunctionType > create(ShPtr< Type > retType=VoidType::create())
Creates a new function type.
Definition: function_type.cpp:168
virtual ShPtr< Value > clone() override
Returns a clone of the value.
Definition: function_type.cpp:26
virtual bool isEqualTo(ShPtr< Value > otherValue) const override
Returns true if this value is equal to otherValue, false otherwise.
Definition: function_type.cpp:34
Params::const_iterator param_iterator
Parameter iterator.
Definition: function_type.h:34
ShPtr< Type > retType
Return type.
Definition: function_type.h:78
ShPtr< Type > getParam(std::size_t n) const
Returns the n-th parameter.
Definition: function_type.cpp:127
FunctionType(ShPtr< Type > retType=VoidType::create())
Constructs a new function type.
Definition: function_type.cpp:23
void addParam(ShPtr< Type > paramType)
Adds a new parameter.
Definition: function_type.cpp:114
bool isVarArg() const
Returns true if the function takes a variable number of arguments, false otherwise.
Definition: function_type.cpp:161
bool hasParams() const
Returns true if the function has some parameters, false otherwise.
Definition: function_type.cpp:88
std::vector< ShPtr< Type > > Params
Container to store types of parameters.
Definition: function_type.h:30
param_iterator param_begin() const
Returns a constant iterator to the parameter.
Definition: function_type.cpp:138
param_iterator param_end() const
Returns a constant iterator past the last parameter.
Definition: function_type.cpp:145
void setRetType(ShPtr< Type > retType)
Sets a new return type.
Definition: function_type.cpp:70
void setVarArg(bool isVarArg=true)
Sets the function either as taking a variable number of arguments or not.
Definition: function_type.cpp:153
Params params
Parameters.
Definition: function_type.h:81
A base class of all types.
Definition: type.h:20
A base class of all visitors.
Definition: visitor.h:95
static ShPtr< VoidType > create()
Creates a void type.
Definition: void_type.cpp:42
A base class of all types.
A representation of an void type.
A library providing API for working with back-end IR.
std::shared_ptr< T > ShPtr
An alias for a shared pointer.
Definition: smart_ptr.h:18
Definition: archive_wrapper.h:19
Declarations, aliases, macros, etc. for the use of smart pointers.