systemc-clang 2.0.0
Parsing SystemC constructs
Loading...
Searching...
No Matches
PortDecl.h
Go to the documentation of this file.
1#ifndef _PORT_DECL_H_
2#define _PORT_DECL_H_
3
4#include <string>
5
6namespace clang {
7class Decl;
8class VarDecl;
9class FieldDecl;
10}; // namespace clang
11
12namespace systemc_clang {
13
15//
16class FindTemplateTypes;
17
21class PortDecl {
22 public:
23 PortDecl();
24 PortDecl(const std::string &, FindTemplateTypes *);
25 PortDecl(const std::string &, const clang::Decl *, FindTemplateTypes *);
26
27 PortDecl(const PortDecl &);
28 virtual ~PortDecl();
29
31 void setModuleName(const std::string &);
32 void setBinding(clang::VarDecl *vd);
33 void setArrayType();
35 void addArraySize(llvm::APInt size);
36
38 bool getArrayType() const;
39 bool isPointerType() const;
40
41 std::vector<llvm::APInt> getArraySizes() const;
42 std::string getName() const;
43 clang::FieldDecl *getAsFieldDecl() const;
44 clang::VarDecl *getAsVarDecl() const;
46
48 std::string asString() const;
49
50 private:
52 std::string port_name_;
57 clang::Decl *field_decl_;
58
61 std::vector<llvm::APInt> array_sizes_;
62};
63} // namespace systemc_clang
64#endif
std::string port_name_
Name of the port.
Definition PortDecl.h:52
std::vector< llvm::APInt > array_sizes_
Definition PortDecl.h:61
clang::VarDecl * getAsVarDecl() const
Definition PortDecl.cpp:83
std::string getName() const
Definition PortDecl.cpp:77
bool getArrayType() const
Get parameters.
Definition PortDecl.cpp:54
std::string asString() const
Produce dump.
Definition PortDecl.cpp:89
void setModuleName(const std::string &)
Set parameters.
Definition PortDecl.cpp:71
void setBinding(clang::VarDecl *vd)
void addArraySize(llvm::APInt size)
Definition PortDecl.cpp:50
clang::FieldDecl * getAsFieldDecl() const
Definition PortDecl.cpp:79
FindTemplateTypes * getTemplateType()
Definition PortDecl.cpp:87
bool is_array_
Is it an array type.
Definition PortDecl.h:60
clang::Decl * field_decl_
Definition PortDecl.h:57
std::vector< llvm::APInt > getArraySizes() const
Definition PortDecl.cpp:73
FindTemplateTypes * template_type_
This holds the types for the port declaration.
Definition PortDecl.h:54
bool isPointerType() const
Definition PortDecl.cpp:56
Clang forward declarations.
Definition FindArgument.h:6