#include "coco/IR/EntityManager.h"
#include "coco/IR/Block.h"
#include "coco/IR/InputList.h"
+#include "coco/IR/OutputList.h"
#include <memory>
virtual const InputList *input(void) const = 0;
public:
+ virtual OutputList *output(void) = 0;
+ virtual const OutputList *output(void) const = 0;
+
+public:
static std::unique_ptr<Module> create(void);
};
--- /dev/null
+#ifndef __COCO_IR_OUTPUT_LIST_H__
+#define __COCO_IR_OUTPUT_LIST_H__
+
+#include "coco/IR/Output.h"
+
+#include "coco/ADT/PtrList.h"
+
+namespace coco
+{
+
+using OutputList = PtrList<Output>;
+
+} // namespace coco
+
+#endif // __COCO_IR_OUTPUT_LIST_H__
public:
coco::InputList *input(void) override { return _input.get(); }
const coco::InputList *input(void) const override { return _input.get(); }
+
+public:
+ std::unique_ptr<coco::OutputList> _output;
+
+public:
+ coco::OutputList *output(void) override { return _output.get(); }
+ const coco::OutputList *output(void) const override { return _output.get(); }
};
} // namespace
// 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->_output = nncc::foundation::make_unique<coco::OutputList>();
m->_instr_link = std::move(ins_link);
m->_block_link = std::move(blk_link);
ASSERT_NE(mutable_m->input(), nullptr);
ASSERT_EQ(immutable_m->input(), mutable_m->input());
+
+ ASSERT_NE(mutable_m->output(), nullptr);
+ ASSERT_EQ(immutable_m->output(), mutable_m->output());
}