--- /dev/null
+#ifndef __COCO_IR_BLOCK_MANAGER_H__
+#define __COCO_IR_BLOCK_MANAGER_H__
+
+#include "coco/IR/Block.h"
+
+#include "coco/ADT/PtrManager.h"
+
+namespace coco
+{
+
+class BlockManager final : public PtrManager<Block>
+{
+public:
+ BlockManager(const PtrLink<Block, Module> *block_link, PtrLink<Instr, Block> *instr_link)
+ : _block_link{block_link}, _instr_link{instr_link}
+ {
+ // DO NOTHING
+ }
+
+private:
+ const PtrLink<Block, Module> * const _block_link;
+ PtrLink<Instr, Block> * const _instr_link;
+
+public:
+ Block *create(void);
+};
+
+} // namespace coco
+
+#endif // __COCO_IR_BLOCK_MANAGER_H__
--- /dev/null
+#include "coco/IR/BlockManager.h"
+
+#include <nncc/foundation/Memory.h>
+
+namespace coco
+{
+
+Block *BlockManager::create(void)
+{
+ return take(nncc::foundation::make_unique<Block>(_block_link, _instr_link));
+}
+
+} // namespace coco
--- /dev/null
+#include "coco/IR/BlockManager.h"
+
+#include <gtest/gtest.h>
+
+TEST(IR_BLOCK_MANAGER, create)
+{
+ coco::PtrLink<coco::Block, coco::Module> block_link;
+ coco::PtrLink<coco::Instr, coco::Block> instr_link;
+
+ coco::BlockManager mgr{&block_link, &instr_link};
+
+ auto blk = mgr.create();
+
+ ASSERT_NE(blk, nullptr);
+}