summaryrefslogtreecommitdiff
path: root/src/passes/Directize.cpp
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/passes/Directize.cpp
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/passes/Directize.cpp')
-rw-r--r--src/passes/Directize.cpp40
1 files changed, 17 insertions, 23 deletions
diff --git a/src/passes/Directize.cpp b/src/passes/Directize.cpp
index 3d8fcdfdd..8f75c8f57 100644
--- a/src/passes/Directize.cpp
+++ b/src/passes/Directize.cpp
@@ -22,13 +22,13 @@
#include <unordered_map>
-#include "wasm.h"
-#include "pass.h"
-#include "wasm-builder.h"
-#include "wasm-traversal.h"
#include "asm_v_wasm.h"
#include "ir/table-utils.h"
#include "ir/utils.h"
+#include "pass.h"
+#include "wasm-builder.h"
+#include "wasm-traversal.h"
+#include "wasm.h"
namespace wasm {
@@ -64,11 +64,8 @@ struct FunctionDirectizer : public WalkerPass<PostWalker<FunctionDirectizer>> {
return;
}
// Everything looks good!
- replaceCurrent(Builder(*getModule()).makeCall(
- name,
- curr->operands,
- curr->type
- ));
+ replaceCurrent(
+ Builder(*getModule()).makeCall(name, curr->operands, curr->type));
}
}
@@ -88,25 +85,25 @@ private:
for (auto*& operand : call->operands) {
operand = builder.makeDrop(operand);
}
- replaceCurrent(
- builder.makeSequence(
- builder.makeBlock(call->operands),
- builder.makeUnreachable()
- )
- );
+ replaceCurrent(builder.makeSequence(builder.makeBlock(call->operands),
+ builder.makeUnreachable()));
changedTypes = true;
}
};
struct Directize : public Pass {
void run(PassRunner* runner, Module* module) override {
- if (!module->table.exists) return;
- if (module->table.imported()) return;
+ if (!module->table.exists)
+ return;
+ if (module->table.imported())
+ return;
for (auto& ex : module->exports) {
- if (ex->kind == ExternalKind::Table) return;
+ if (ex->kind == ExternalKind::Table)
+ return;
}
FlatTable flatTable(module->table);
- if (!flatTable.valid) return;
+ if (!flatTable.valid)
+ return;
// The table exists and is constant, so this is possible.
{
PassRunner runner(module);
@@ -119,9 +116,6 @@ struct Directize : public Pass {
} // anonymous namespace
-Pass *createDirectizePass() {
- return new Directize();
-}
+Pass* createDirectizePass() { return new Directize(); }
} // namespace wasm
-