Per-function deduplication.

This commit is contained in:
Daniel Kirchner 2022-12-14 18:20:45 +01:00
parent 3801847ccd
commit 5cc6a5b9e8

View File

@ -408,10 +408,10 @@ map<u256, u256> const& Assembly::optimiseInternal(
} }
// This only modifies PushTags, we have to run again to actually remove code. // This only modifies PushTags, we have to run again to actually remove code.
// TODO: investigate options for EOF. if (_settings.runDeduplicate)
if (_settings.runDeduplicate && !m_eofVersion.has_value()) for (auto& section: m_codeSections)
{ {
BlockDeduplicator deduplicator{m_codeSections.front().items}; BlockDeduplicator deduplicator{section.items};
if (deduplicator.deduplicate()) if (deduplicator.deduplicate())
{ {
for (auto const& replacement: deduplicator.replacedTags()) for (auto const& replacement: deduplicator.replacedTags())