From db9124f1de0478dcac525009b6f1589b44a7edd8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 26 Apr 2019 16:59:41 -0700 Subject: Apply format changes from #2048 (#2059) Mass change to apply clang-format to everything. We are applying this in a PR by me so the (git) blame is all mine ;) but @aheejin did all the work to get clang-format set up and all the manual work to tidy up some things to make the output nicer in #2048 --- src/ir/module-utils.h | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'src/ir/module-utils.h') diff --git a/src/ir/module-utils.h b/src/ir/module-utils.h index fe99a458f..5569843fd 100644 --- a/src/ir/module-utils.h +++ b/src/ir/module-utils.h @@ -17,10 +17,10 @@ #ifndef wasm_ir_module_h #define wasm_ir_module_h -#include "wasm-binary.h" -#include "wasm.h" #include "ir/find_all.h" #include "ir/manipulation.h" +#include "wasm-binary.h" +#include "wasm.h" namespace wasm { @@ -75,7 +75,8 @@ inline Function* copyFunction(Function* func, Module& out) { ret->result = func->result; ret->params = func->params; ret->vars = func->vars; - ret->type = Name(); // start with no named type; the names in the other module may differ + // start with no named type; the names in the other module may differ + ret->type = Name(); ret->localNames = func->localNames; ret->localIndices = func->localIndices; ret->debugLocations = func->debugLocations; @@ -138,8 +139,7 @@ inline void copyModule(Module& in, Module& out) { // Note that for this to work the functions themselves don't necessarily need // to exist. For example, it is possible to remove a given function and then // call this redirect all of its uses. -template -inline void renameFunctions(Module& wasm, T& map) { +template inline void renameFunctions(Module& wasm, T& map) { // Update the function itself. for (auto& pair : map) { if (Function* F = wasm.getFunctionOrNull(pair.first)) { @@ -186,36 +186,31 @@ inline void renameFunction(Module& wasm, Name oldName, Name newName) { // Convenient iteration over imported/non-imported module elements -template -inline void iterImportedMemories(Module& wasm, T visitor) { +template inline void iterImportedMemories(Module& wasm, T visitor) { if (wasm.memory.exists && wasm.memory.imported()) { visitor(&wasm.memory); } } -template -inline void iterDefinedMemories(Module& wasm, T visitor) { +template inline void iterDefinedMemories(Module& wasm, T visitor) { if (wasm.memory.exists && !wasm.memory.imported()) { visitor(&wasm.memory); } } -template -inline void iterImportedTables(Module& wasm, T visitor) { +template inline void iterImportedTables(Module& wasm, T visitor) { if (wasm.table.exists && wasm.table.imported()) { visitor(&wasm.table); } } -template -inline void iterDefinedTables(Module& wasm, T visitor) { +template inline void iterDefinedTables(Module& wasm, T visitor) { if (wasm.table.exists && !wasm.table.imported()) { visitor(&wasm.table); } } -template -inline void iterImportedGlobals(Module& wasm, T visitor) { +template inline void iterImportedGlobals(Module& wasm, T visitor) { for (auto& import : wasm.globals) { if (import->imported()) { visitor(import.get()); @@ -223,8 +218,7 @@ inline void iterImportedGlobals(Module& wasm, T visitor) { } } -template -inline void iterDefinedGlobals(Module& wasm, T visitor) { +template inline void iterDefinedGlobals(Module& wasm, T visitor) { for (auto& import : wasm.globals) { if (!import->imported()) { visitor(import.get()); @@ -241,8 +235,7 @@ inline void iterImportedFunctions(Module& wasm, T visitor) { } } -template -inline void iterDefinedFunctions(Module& wasm, T visitor) { +template inline void iterDefinedFunctions(Module& wasm, T visitor) { for (auto& import : wasm.functions) { if (!import->imported()) { visitor(import.get()); -- cgit v1.2.3