summaryrefslogtreecommitdiff
path: root/src/ir/module-utils.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-04-26 16:59:41 -0700
committerGitHub <noreply@github.com>2019-04-26 16:59:41 -0700
commitdb9124f1de0478dcac525009b6f1589b44a7edd8 (patch)
treefa26395a0f6cca53cf5cb6e10189f989c5bfa847 /src/ir/module-utils.h
parent87636dccd404a340d75acb1d96301581343f29ca (diff)
downloadbinaryen-db9124f1de0478dcac525009b6f1589b44a7edd8.tar.gz
binaryen-db9124f1de0478dcac525009b6f1589b44a7edd8.tar.bz2
binaryen-db9124f1de0478dcac525009b6f1589b44a7edd8.zip
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
Diffstat (limited to 'src/ir/module-utils.h')
-rw-r--r--src/ir/module-utils.h31
1 files changed, 12 insertions, 19 deletions
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<typename T>
-inline void renameFunctions(Module& wasm, T& map) {
+template<typename T> 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<typename T>
-inline void iterImportedMemories(Module& wasm, T visitor) {
+template<typename T> inline void iterImportedMemories(Module& wasm, T visitor) {
if (wasm.memory.exists && wasm.memory.imported()) {
visitor(&wasm.memory);
}
}
-template<typename T>
-inline void iterDefinedMemories(Module& wasm, T visitor) {
+template<typename T> inline void iterDefinedMemories(Module& wasm, T visitor) {
if (wasm.memory.exists && !wasm.memory.imported()) {
visitor(&wasm.memory);
}
}
-template<typename T>
-inline void iterImportedTables(Module& wasm, T visitor) {
+template<typename T> inline void iterImportedTables(Module& wasm, T visitor) {
if (wasm.table.exists && wasm.table.imported()) {
visitor(&wasm.table);
}
}
-template<typename T>
-inline void iterDefinedTables(Module& wasm, T visitor) {
+template<typename T> inline void iterDefinedTables(Module& wasm, T visitor) {
if (wasm.table.exists && !wasm.table.imported()) {
visitor(&wasm.table);
}
}
-template<typename T>
-inline void iterImportedGlobals(Module& wasm, T visitor) {
+template<typename T> 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<typename T>
-inline void iterDefinedGlobals(Module& wasm, T visitor) {
+template<typename T> 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<typename T>
-inline void iterDefinedFunctions(Module& wasm, T visitor) {
+template<typename T> inline void iterDefinedFunctions(Module& wasm, T visitor) {
for (auto& import : wasm.functions) {
if (!import->imported()) {
visitor(import.get());