diff options
author | Alon Zakai <azakai@google.com> | 2019-04-26 16:59:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-26 16:59:41 -0700 |
commit | db9124f1de0478dcac525009b6f1589b44a7edd8 (patch) | |
tree | fa26395a0f6cca53cf5cb6e10189f989c5bfa847 /src/ir/flat.h | |
parent | 87636dccd404a340d75acb1d96301581343f29ca (diff) | |
download | binaryen-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/flat.h')
-rw-r--r-- | src/ir/flat.h | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/src/ir/flat.h b/src/ir/flat.h index ed6178ef5..199d5e35e 100644 --- a/src/ir/flat.h +++ b/src/ir/flat.h @@ -55,8 +55,9 @@ #ifndef wasm_ir_flat_h #define wasm_ir_flat_h -#include "wasm-traversal.h" #include "ir/iteration.h" +#include "pass.h" +#include "wasm-traversal.h" namespace wasm { @@ -67,23 +68,29 @@ inline bool isControlFlowStructure(Expression* curr) { } inline void verifyFlatness(Function* func) { - struct VerifyFlatness : public PostWalker<VerifyFlatness, UnifiedExpressionVisitor<VerifyFlatness>> { + struct VerifyFlatness + : public PostWalker<VerifyFlatness, + UnifiedExpressionVisitor<VerifyFlatness>> { void visitExpression(Expression* curr) { if (isControlFlowStructure(curr)) { - verify(!isConcreteType(curr->type), "control flow structures must not flow values"); + verify(!isConcreteType(curr->type), + "control flow structures must not flow values"); } else if (curr->is<SetLocal>()) { verify(!isConcreteType(curr->type), "tees are not allowed, only sets"); } else { for (auto* child : ChildIterator(curr)) { - verify(child->is<Const>() || child->is<GetLocal>() || child->is<Unreachable>(), - "instructions must only have const, local.get, or unreachable as children"); + verify(child->is<Const>() || child->is<GetLocal>() || + child->is<Unreachable>(), + "instructions must only have const, local.get, or unreachable " + "as children"); } } } void verify(bool condition, const char* message) { if (!condition) { - Fatal() << "IR must be flat: run --flatten beforehand (" << message << ", in " << getFunction()->name << ')'; + Fatal() << "IR must be flat: run --flatten beforehand (" << message + << ", in " << getFunction()->name << ')'; } } }; @@ -91,20 +98,19 @@ inline void verifyFlatness(Function* func) { VerifyFlatness verifier; verifier.walkFunction(func); verifier.setFunction(func); - verifier.verify(!isConcreteType(func->body->type), "function bodies must not flow values"); + verifier.verify(!isConcreteType(func->body->type), + "function bodies must not flow values"); } inline void verifyFlatness(Module* module) { - struct VerifyFlatness : public WalkerPass<PostWalker<VerifyFlatness, UnifiedExpressionVisitor<VerifyFlatness>>> { + struct VerifyFlatness + : public WalkerPass< + PostWalker<VerifyFlatness, UnifiedExpressionVisitor<VerifyFlatness>>> { bool isFunctionParallel() override { return true; } - VerifyFlatness* create() override { - return new VerifyFlatness(); - } + VerifyFlatness* create() override { return new VerifyFlatness(); } - void doVisitFunction(Function* func) { - verifyFlatness(func); - } + void doVisitFunction(Function* func) { verifyFlatness(func); } }; PassRunner runner(module); @@ -113,7 +119,7 @@ inline void verifyFlatness(Module* module) { runner.run(); } -} // namespace Fkat +} // namespace Flat } // namespace wasm |