From 12445969dc5b32cbe82b829fe8c061f5d98fcbe7 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Fri, 24 Apr 2020 15:51:11 -0700 Subject: Remove --fuzz-binary and simplify round trip (#2799) Since the --roundtrip pass is more general than --fuzz-binary anyways. Also reimplements `ModuleUtils::clearModule` to use the module destructor and placement new to ensure that no members are missed. --- src/ir/module-utils.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/ir/module-utils.h') diff --git a/src/ir/module-utils.h b/src/ir/module-utils.h index e589f5052..ab23649f7 100644 --- a/src/ir/module-utils.h +++ b/src/ir/module-utils.h @@ -99,17 +99,8 @@ inline void copyModule(const Module& in, Module& out) { } inline void clearModule(Module& wasm) { - wasm.exports.clear(); - wasm.functions.clear(); - wasm.globals.clear(); - wasm.events.clear(); - wasm.table.clear(); - wasm.memory.clear(); - wasm.start = Name(); - wasm.userSections.clear(); - wasm.debugInfoFileNames.clear(); - wasm.updateMaps(); - wasm.allocator.clear(); + wasm.~Module(); + new (&wasm) Module; } // Renaming -- cgit v1.2.3