From db21426288a4f978eeebd26aa7477a1adb6fdafd Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=82=A8=EA=B6=81=EC=84=9D/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Engineer/=EC=82=BC=EC=84=B1=EC=A0=84?= =?utf8?q?=EC=9E=90?= Date: Tue, 11 Dec 2018 18:37:33 +0900 Subject: [PATCH] [enco] Remove deprecated intermediates function (#2618) This commit will remove deprecated function, `intermediates` Signed-off-by: Seok NamKoong --- contrib/enco/core/src/CppCode.cpp | 63 --------------------------------------- 1 file changed, 63 deletions(-) diff --git a/contrib/enco/core/src/CppCode.cpp b/contrib/enco/core/src/CppCode.cpp index 8822b2c..7fd1485 100644 --- a/contrib/enco/core/src/CppCode.cpp +++ b/contrib/enco/core/src/CppCode.cpp @@ -137,69 +137,6 @@ std::set hosted(const enco::Code *code) return res; } - -// WARN Deprecated -/** @brief Return a set of Bag to be allocated */ -// NOTE An input/output bag may be included in the retrun set of "intermediates" -std::set intermediates(const enco::Code *code) -{ - // NOTE The current implementation may allocate unnecessary buffers (such as weight) - // TODO Optimize this! - std::set res; - - auto accessed_by_host = [code](const coco::Bag *b) { - auto block_of = [](coco::Locatable *loc) -> coco::Block * { - if (auto ins = loc->loc()) - { - if (auto blk = ins->parent()) - { - return blk; - } - } - - return nullptr; - }; - - auto is_host_block = [code](const coco::Block *blk) { - auto m = blk->module(); - auto ann_ctx = enco::SubnetManager::context(m); - return (blk) ? (ann_ctx->find(blk) == nullptr) : false; - }; - - for (const auto &updater : coco::updaters(b)) - { - if (is_host_block(block_of(updater))) - { - return true; - } - } - - for (const auto &reader : coco::readers(b)) - { - if (is_host_block(block_of(reader))) - { - return true; - } - } - - return false; - }; - - for (uint32_t n = 0; n < code->module()->entity()->bag()->size(); ++n) - { - auto bag = code->module()->entity()->bag()->at(n); - - // TODO Remove unnecessary indentation - { - if (accessed_by_host(bag)) - { - res.insert(bag); - } - } - } - - return res; -} } // namespace namespace enco -- 2.7.4