retdec
function_builder.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LLVMIR2HLL_IR_FUNCTION_BUILDER_H
8 #define RETDEC_LLVMIR2HLL_IR_FUNCTION_BUILDER_H
9 
10 #include <string>
11 
14 
15 namespace retdec {
16 namespace llvmir2hll {
17 
18 class Function;
19 class Statement;
20 class Type;
21 class Variable;
22 
46 public:
47  FunctionBuilder(const std::string &funcName = "");
48 
58 
60 
61 private:
63 
64 private:
67 };
68 
69 } // namespace llvmir2hll
70 } // namespace retdec
71 
72 #endif
A builder providing a simple way of creating functions.
Definition: function_builder.h:45
FunctionBuilder & withParam(ShPtr< Variable > param)
Adds the given parameter to the function.
Definition: function_builder.cpp:105
ShPtr< Function > func
A function that is being built.
Definition: function_builder.h:66
FunctionBuilder & definitionWithBody(ShPtr< Statement > body)
Makes the function a definition with the given body.
Definition: function_builder.cpp:63
FunctionBuilder(const std::string &funcName="")
Constructs a builder providing the default function named funcName.
Definition: function_builder.cpp:40
FunctionBuilder & definitionWithEmptyBody()
Makes the function a definition with an empty body.
Definition: function_builder.cpp:49
ShPtr< Function > build()
Returns the built function.
Definition: function_builder.cpp:77
FunctionBuilder & withRetType(ShPtr< Type > retType)
Makes the function to have the given return type.
Definition: function_builder.cpp:90
FunctionBuilder & withLocalVar(ShPtr< Variable > var)
Adds the given local variable to the function.
Definition: function_builder.cpp:120
FunctionBuilder & withVarArg()
Makes the function taking a variable number of arguments.
Definition: function_builder.cpp:134
ShPtr< Function > releaseFuncAndInvalidateBuilder()
Releases the built function and invalidates the builder.
Definition: function_builder.cpp:144
A mixin to make classes non-copyable.
Definition: non_copyable.h:27
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
A mixin to make classes non-copyable.
Declarations, aliases, macros, etc. for the use of smart pointers.