diff options
author | Heejin Ahn <aheejin@gmail.com> | 2019-12-29 21:13:12 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-29 21:13:12 -0800 |
commit | a30f1df5696ccb3490e2eaa3a9ed5e7e487c7b0e (patch) | |
tree | 3ba1038677a2d5337603682ba80666823eee9552 /src/passes/Asyncify.cpp | |
parent | f2ba91b6340a8c3099ab6a48700c717cbd33599e (diff) | |
download | binaryen-a30f1df5696ccb3490e2eaa3a9ed5e7e487c7b0e.tar.gz binaryen-a30f1df5696ccb3490e2eaa3a9ed5e7e487c7b0e.tar.bz2 binaryen-a30f1df5696ccb3490e2eaa3a9ed5e7e487c7b0e.zip |
Move Type-related functions into Type class (NFC) (#2556)
Several type-related functions currently exist outside of `Type`
class and thus in the `wasm`, effectively global, namespace. This moves
these functions into `Type` class, making them either member functions
or static functions.
Also this renames `getSize` to `getByteSize` to make it not to be
confused with `size`, which returns the number of types in multiple
types. This also reorders the order of functions in `wasm-type.cpp` to
match that of `wasm-type.h`.
Diffstat (limited to 'src/passes/Asyncify.cpp')
-rw-r--r-- | src/passes/Asyncify.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/passes/Asyncify.cpp b/src/passes/Asyncify.cpp index 8e583863c..8f929d9fe 100644 --- a/src/passes/Asyncify.cpp +++ b/src/passes/Asyncify.cpp @@ -1090,7 +1090,7 @@ private: Index total = 0; for (Index i = 0; i < numPreservableLocals; i++) { auto type = func->getLocalType(i); - auto size = getTypeSize(type); + auto size = type.getByteSize(); total += size; } auto* block = builder->makeBlock(); @@ -1101,7 +1101,7 @@ private: Index offset = 0; for (Index i = 0; i < numPreservableLocals; i++) { auto type = func->getLocalType(i); - auto size = getTypeSize(type); + auto size = type.getByteSize(); assert(size % STACK_ALIGN == 0); // TODO: higher alignment? block->list.push_back(builder->makeLocalSet( @@ -1130,7 +1130,7 @@ private: Index offset = 0; for (Index i = 0; i < numPreservableLocals; i++) { auto type = func->getLocalType(i); - auto size = getTypeSize(type); + auto size = type.getByteSize(); assert(size % STACK_ALIGN == 0); // TODO: higher alignment? block->list.push_back( |