diff options
author | Alon Zakai <azakai@google.com> | 2021-11-09 11:35:42 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-09 11:35:42 -0800 |
commit | a0325162a4b54f795d17550bff2b565c379dde51 (patch) | |
tree | 5530e2cf03c443b274b88f70f8f661489c1f0408 /src/ir/struct-utils.h | |
parent | 1ad4e23342ef83b9210ce81bbf119047e08b6f3b (diff) | |
download | binaryen-a0325162a4b54f795d17550bff2b565c379dde51.tar.gz binaryen-a0325162a4b54f795d17550bff2b565c379dde51.tar.bz2 binaryen-a0325162a4b54f795d17550bff2b565c379dde51.zip |
[NFC] Add StructUtils namespace, and Scanner => StructScanner (#4317)
This avoids cluttering the main wasm namespace, and clarifies what the
scanner does.
Diffstat (limited to 'src/ir/struct-utils.h')
-rw-r--r-- | src/ir/struct-utils.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ir/struct-utils.h b/src/ir/struct-utils.h index 5d0f5a9b8..f1741fb27 100644 --- a/src/ir/struct-utils.h +++ b/src/ir/struct-utils.h @@ -22,6 +22,8 @@ namespace wasm { +namespace StructUtils { + // A vector of a template type's values. One such vector will be used per struct // type, where each element in the vector represents a field. We always assume // that the vectors are pre-initialized to the right length before accessing any @@ -128,11 +130,12 @@ struct FunctionStructValuesMap // type being written to, and not just that it is of a subtype of the // instruction's type, which helps later. template<typename T, typename SubType> -struct Scanner : public WalkerPass<PostWalker<Scanner<T, SubType>>> { +struct StructScanner + : public WalkerPass<PostWalker<StructScanner<T, SubType>>> { bool isFunctionParallel() override { return true; } - Scanner(FunctionStructValuesMap<T>& functionNewInfos, - FunctionStructValuesMap<T>& functionSetGetInfos) + StructScanner(FunctionStructValuesMap<T>& functionNewInfos, + FunctionStructValuesMap<T>& functionSetGetInfos) : functionNewInfos(functionNewInfos), functionSetGetInfos(functionSetGetInfos) {} @@ -267,6 +270,8 @@ private: } }; +} // namespace StructUtils + } // namespace wasm #endif // wasm_ir_struct_utils_h |