From 9495b338121140d585648d64fb99e8ef7f92f867 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Fri, 12 Apr 2019 18:27:13 -0700 Subject: Move features from passOptions to Module (#2001) This allows us to emit a (potentially modified) target features section and conditionally emit other sections such as the DataCount section based on the presence of features. --- src/ir/memory-utils.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ir/memory-utils.h') diff --git a/src/ir/memory-utils.h b/src/ir/memory-utils.h index 0bad50c5a..fbf1f646c 100644 --- a/src/ir/memory-utils.h +++ b/src/ir/memory-utils.h @@ -69,6 +69,12 @@ namespace MemoryUtils { return true; } + // Conservatively refuse to change segments if there might be memory.init + // and data.drop instructions. + if (module.features.hasBulkMemory()) { + return false; + } + auto isEmpty = [](Memory::Segment& segment) { return segment.data.size() == 0; }; -- cgit v1.2.3