#define __COCO_IR_MODULE_H__
#include "coco/IR/EntityManager.h"
+#include "coco/IR/Block.h"
#include "coco/IR/InputList.h"
#include <memory>
virtual const EntityManager *entity(void) const = 0;
public:
+ virtual BlockList *block(void) = 0;
+ virtual const BlockList *block(void) const = 0;
+
+public:
virtual InputList *input(void) = 0;
virtual const InputList *input(void) const = 0;
const coco::EntityManager *entity(void) const override { return _entity.get(); }
public:
+ std::unique_ptr<coco::BlockList> _block;
+
+public:
+ coco::BlockList *block(void) override { return _block.get(); }
+ const coco::BlockList *block(void) const override { return _block.get(); }
+
+public:
std::unique_ptr<coco::InputList> _input;
public:
}
m->_entity = std::move(mgr);
+ // NOTE BlockManager and BlockList SHOULD share 'blk_link'
+ m->_block = nncc::foundation::make_unique<coco::BlockList>(m.get(), blk_link.get());
m->_input = nncc::foundation::make_unique<coco::InputList>();
m->_instr_link = std::move(ins_link);
ASSERT_NE(mutable_m->entity()->input(), nullptr);
ASSERT_EQ(immutable_m->entity()->input(), mutable_m->entity()->input());
+ ASSERT_NE(mutable_m->block(), nullptr);
+ ASSERT_EQ(immutable_m->block(), mutable_m->block());
+
ASSERT_NE(mutable_m->input(), nullptr);
ASSERT_EQ(immutable_m->input(), mutable_m->input());
}