From bebe76828a6c8ccfc3e61a066a43530f715aeee9 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 5 May 2015 17:45:58 +0200 Subject: CFG returns vector of blocks instead of assembly items. --- Assembly.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Assembly.cpp') diff --git a/Assembly.cpp b/Assembly.cpp index aec06aef..9530ded4 100644 --- a/Assembly.cpp +++ b/Assembly.cpp @@ -318,7 +318,10 @@ Assembly& Assembly::optimise(bool _enable) copt << "Performing control flow analysis..."; { ControlFlowGraph cfg(m_items); - AssemblyItems optItems = cfg.optimisedItems(); + AssemblyItems optItems; + for (BasicBlock const& block: cfg.optimisedBlocks()) + copy(m_items.begin() + block.begin, m_items.begin() + block.end, + back_inserter(optItems)); if (optItems.size() < m_items.size()) { copt << "Old size: " << m_items.size() << ", new size: " << optItems.size(); -- cgit