Commit 3de49875 authored by rmrf's avatar rmrf

Focus on ModuleDecl rework

parent e11f6e1d
...@@ -5,13 +5,18 @@ using namespace scpar; ...@@ -5,13 +5,18 @@ using namespace scpar;
using std::string; using std::string;
ModuleDecl::ModuleDecl() : module_name_{"NONE"}, class_decl_{nullptr} {} ModuleDecl::ModuleDecl() : module_name_{"NONE"},
class_decl_{nullptr},
constructor_stmt_{nullptr} {}
ModuleDecl::ModuleDecl(const string &name, CXXRecordDecl *decl) ModuleDecl::ModuleDecl(const string &name, CXXRecordDecl *decl)
: module_name_{name}, class_decl_{decl} {} : module_name_{name}, class_decl_{decl} {}
ModuleDecl::~ModuleDecl() { ModuleDecl::~ModuleDecl() {
class_decl_ = nullptr;
constructor_stmt_ = nullptr;
// Delete all pointers in ports. // Delete all pointers in ports.
for (auto input_port : _iports) { for (auto input_port : _iports) {
// Second is the PortDecl*. // Second is the PortDecl*.
...@@ -113,7 +118,7 @@ void ModuleDecl::addInputOutputInterfaces(FindTLMInterfaces::interfaceType p) { ...@@ -113,7 +118,7 @@ void ModuleDecl::addInputOutputInterfaces(FindTLMInterfaces::interfaceType p) {
} }
void ModuleDecl::addConstructor(Stmt *constructor) { void ModuleDecl::addConstructor(Stmt *constructor) {
_constructorStmt = constructor; constructor_stmt_ = constructor;
} }
void ModuleDecl::addProcess(FindEntryFunctions::entryFunctionVectorType *efv) { void ModuleDecl::addProcess(FindEntryFunctions::entryFunctionVectorType *efv) {
......
...@@ -84,6 +84,8 @@ public: ...@@ -84,6 +84,8 @@ public:
private: private:
string module_name_; string module_name_;
CXXRecordDecl *class_decl_; CXXRecordDecl *class_decl_;
Stmt *constructor_stmt_;
processMapType _processes; processMapType _processes;
portMapType _iports; portMapType _iports;
portMapType _oports; portMapType _oports;
...@@ -92,7 +94,7 @@ private: ...@@ -92,7 +94,7 @@ private:
interfaceMapType _ointerfaces; interfaceMapType _ointerfaces;
interfaceMapType _iointerfaces; interfaceMapType _iointerfaces;
signalMapType _signals; signalMapType _signals;
Stmt *_constructorStmt;
vector<string> _instanceList; vector<string> _instanceList;
portSignalMapType _portSignalMap; portSignalMapType _portSignalMap;
vector<EntryFunctionContainer *> _vef; vector<EntryFunctionContainer *> _vef;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment