7 #ifndef RETDEC_CTYPES_FUNCTION_H
8 #define RETDEC_CTYPES_FUNCTION_H
38 static std::shared_ptr<Function>
create(
39 const std::shared_ptr<Context> &context,
40 const std::string &
name,
41 const std::shared_ptr<Type> &returnType,
47 const std::string &
getName()
const;
48 std::shared_ptr<FunctionType>
getType()
const;
87 const std::string &
name,
93 const std::shared_ptr<Context> &context,
94 const std::shared_ptr<Type> &returnType,
A representation of a C call convention.
A representation of a C call convention.
Definition: call_convention.h:19
A representation of a function declaration.
Definition: function_declaration.h:19
VarArgness
Definition: function_type.h:33
A representation of a C function.
Definition: function.h:30
const std::string & getName() const
Definition: function.cpp:26
HeaderFile getHeaderFile() const
Returns header file of function.
Definition: function.cpp:255
bool isVarArg() const
Returns true if function takes variable number of arguments, false otherwise.
Definition: function.cpp:132
const Parameter & getParameter(Parameters::size_type n) const
Returns the n-th parameter.
Definition: function.cpp:97
void setHeaderFile(const HeaderFile &headerFile)
Sets header file of function.
Definition: function.cpp:247
HeaderFile headerFile
Definition: function.h:105
Parameters::iterator parameter_iterator
Definition: function.h:34
void setDeclaration(const FunctionDeclaration &declaration)
Sets function declaration.
Definition: function.cpp:231
std::shared_ptr< Type > getReturnType() const
Returns function's return type.
Definition: function.cpp:42
FunctionDeclaration getDeclaration() const
Returns function declaration.
Definition: function.cpp:239
static std::shared_ptr< Function > create(const std::shared_ptr< Context > &context, const std::string &name, const std::shared_ptr< Type > &returnType, const Parameters ¶meters, const CallConvention &callConvention=CallConvention(), VarArgness varArgness=VarArgness::IsNotVarArg)
Creates function.
Definition: function.cpp:154
FunctionDeclaration declaration
Definition: function.h:104
const std::string & getParameterName(Parameters::size_type n) const
Returns the n-th parameter's name.
Definition: function.cpp:110
Parameters::size_type getParameterCount() const
Returns the number of parameters.
Definition: function.cpp:84
Parameters parameters
Definition: function.h:103
Function(const std::string &name, const std::shared_ptr< FunctionType > &functionType, const Parameters ¶meters)
Constructs a new function.
Definition: function.cpp:20
std::vector< Parameter > Parameters
Definition: function.h:32
static std::shared_ptr< FunctionType > createFunctionType(const std::shared_ptr< Context > &context, const std::shared_ptr< Type > &returnType, const Parameters ¶meters, const CallConvention &callConvention, VarArgness varArgness)
Creates function type.
Definition: function.cpp:194
parameter_iterator parameter_begin()
Returns an iterator to the parameter.
Definition: function.cpp:50
std::shared_ptr< Type > getParameterType(Parameters::size_type n) const
Returns the n-th parameter's type.
Definition: function.cpp:123
std::string name
Definition: function.h:101
const CallConvention & getCallConvention() const
Returns function's call convention.
Definition: function.cpp:223
Parameters::const_iterator const_parameter_iterator
Definition: function.h:35
std::shared_ptr< FunctionType > getType() const
Returns function's function type - return type and parameters' types.
Definition: function.cpp:34
void setCallConvention(const CallConvention &callConvention)
Sets function's call convention.
Definition: function.cpp:215
parameter_iterator parameter_end()
Returns an iterator past the last parameter.
Definition: function.cpp:66
std::shared_ptr< FunctionType > functionType
Definition: function.h:102
A representation of a function parameter.
Definition: parameter.h:24
A representation of a function type.
A representation of a C function declaration.
Definition: archive_wrapper.h:19