diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2020-04-24 15:51:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-24 15:51:11 -0700 |
commit | 12445969dc5b32cbe82b829fe8c061f5d98fcbe7 (patch) | |
tree | f9b6bd44d3b7cd7864c148a698712b32f802348e /src/ir/module-utils.h | |
parent | 204cc7b7172d665ee731171d20995edb5897ef7d (diff) | |
download | binaryen-12445969dc5b32cbe82b829fe8c061f5d98fcbe7.tar.gz binaryen-12445969dc5b32cbe82b829fe8c061f5d98fcbe7.tar.bz2 binaryen-12445969dc5b32cbe82b829fe8c061f5d98fcbe7.zip |
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.
Diffstat (limited to 'src/ir/module-utils.h')
-rw-r--r-- | src/ir/module-utils.h | 13 |
1 files changed, 2 insertions, 11 deletions
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 |