From a0325162a4b54f795d17550bff2b565c379dde51 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 9 Nov 2021 11:35:42 -0800 Subject: [NFC] Add StructUtils namespace, and Scanner => StructScanner (#4317) This avoids cluttering the main wasm namespace, and clarifies what the scanner does. --- src/ir/struct-utils.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/ir/struct-utils.h') 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 -struct Scanner : public WalkerPass>> { +struct StructScanner + : public WalkerPass>> { bool isFunctionParallel() override { return true; } - Scanner(FunctionStructValuesMap& functionNewInfos, - FunctionStructValuesMap& functionSetGetInfos) + StructScanner(FunctionStructValuesMap& functionNewInfos, + FunctionStructValuesMap& functionSetGetInfos) : functionNewInfos(functionNewInfos), functionSetGetInfos(functionSetGetInfos) {} @@ -267,6 +270,8 @@ private: } }; +} // namespace StructUtils + } // namespace wasm #endif // wasm_ir_struct_utils_h -- cgit v1.2.3