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/passes/MemoryPacking.cpp | |
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/passes/MemoryPacking.cpp')
-rw-r--r-- | src/passes/MemoryPacking.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/passes/MemoryPacking.cpp b/src/passes/MemoryPacking.cpp index 704f57d89..11dbc1743 100644 --- a/src/passes/MemoryPacking.cpp +++ b/src/passes/MemoryPacking.cpp @@ -15,9 +15,9 @@ */ #include "pass.h" -#include "wasm.h" #include "wasm-binary.h" #include "wasm-builder.h" +#include "wasm.h" namespace wasm { @@ -57,7 +57,8 @@ struct MemoryPacking : public Pass { }; for (auto& segment : module->memory.segments) { - if (!isSplittable(segment)) continue; + if (!isSplittable(segment)) + continue; // skip final zeros while (segment.data.size() > 0 && segment.data.back() == 0) { @@ -81,7 +82,7 @@ struct MemoryPacking : public Pass { start++; } Index end = start; // end of data-containing part - Index next = end; // after zeros we can skip. preserves next >= end + Index next = end; // after zeros we can skip. preserves next >= end if (!shouldSplit()) { next = end = data.size(); } @@ -99,7 +100,10 @@ struct MemoryPacking : public Pass { } } if (end != start) { - packed.emplace_back(Builder(*module).makeConst(Literal(int32_t(base + start))), &data[start], end - start); + packed.emplace_back( + Builder(*module).makeConst(Literal(int32_t(base + start))), + &data[start], + end - start); } start = next; } @@ -109,8 +113,6 @@ struct MemoryPacking : public Pass { } }; -Pass *createMemoryPackingPass() { - return new MemoryPacking(); -} +Pass* createMemoryPackingPass() { return new MemoryPacking(); } } // namespace wasm |