retdec
function_type.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_FUNCTION_TYPE_H
8 #define RETDEC_FUNCTION_TYPE_H
9 
13 
14 namespace retdec {
15 namespace demangler {
16 namespace borland {
17 
18 enum class CallConv
19 {
21  cc_cdecl,
22  cc_pascal,
23  cc_stdcall,
24  cc_unknown,
25 };
26 
31 class FunctionTypeNode : public TypeNode
32 {
33 public:
34  static std::shared_ptr<FunctionTypeNode> create(
36  std::shared_ptr<NodeArray> params,
37  std::shared_ptr<TypeNode> retType,
39  bool isVarArg);
40 
42 
43  std::shared_ptr<NodeArray> params();
44 
45  std::shared_ptr<TypeNode> retType();
46 
47  bool isVarArg();
48 
49  void printLeft(std::ostream &s) const override;
50 
51  void printRight(std::ostream &s) const override;
52 
53 private:
56  std::shared_ptr<NodeArray> params,
57  std::shared_ptr<TypeNode> retType,
59  bool isVarArg);
60 
61 private:
63  std::shared_ptr<NodeArray> _params;
64  std::shared_ptr<TypeNode> _retType;
65  bool _isVarArg;
66 };
67 
68 } // borland
69 } // demangler
70 } // retdec
71 
72 #endif //RETDEC_FUNCTION_TYPE_H
Representation of function types. Used for information about functions without name.
Definition: function_type.h:32
void printRight(std::ostream &s) const override
Definition: function_type.cpp:98
static std::shared_ptr< FunctionTypeNode > create(CallConv callConv, std::shared_ptr< NodeArray > params, std::shared_ptr< TypeNode > retType, Qualifiers &quals, bool isVarArg)
Function for creating function types.
Definition: function_type.cpp:39
bool _isVarArg
Definition: function_type.h:65
CallConv _callConv
Definition: function_type.h:62
CallConv callConv()
Definition: function_type.cpp:49
std::shared_ptr< TypeNode > retType()
Definition: function_type.cpp:59
std::shared_ptr< TypeNode > _retType
Definition: function_type.h:64
std::shared_ptr< NodeArray > _params
Definition: function_type.h:63
bool isVarArg()
Definition: function_type.cpp:64
FunctionTypeNode(CallConv callConv, std::shared_ptr< NodeArray > params, std::shared_ptr< TypeNode > retType, Qualifiers &quals, bool isVarArg)
Private constructor for function types. Use create().
Definition: function_type.cpp:18
void printLeft(std::ostream &s) const override
Definition: function_type.cpp:72
std::shared_ptr< NodeArray > params()
Definition: function_type.cpp:54
Definition: qualifiers.h:20
Base class for all type nodes.
Definition: type_node.h:21
Qualifiers quals()
Definition: type_node.cpp:23
CallConv
Definition: function_type.h:19
Definition: archive_wrapper.h:19
Representation of arrays of nodes in borland AST.
Base class for all types in borland AST.