2121
2222namespace wasm {
2323
24- struct ExpressionManipulator {
24+ namespace ExpressionManipulator {
2525 // Re-use a node's memory. This helps avoid allocation when optimizing.
2626 template <typename InputType, typename OutputType>
27- static OutputType* convert (InputType *input) {
27+ inline OutputType* convert (InputType *input) {
2828 static_assert (sizeof (OutputType) <= sizeof (InputType),
2929 " Can only convert to a smaller size Expression node" );
3030 input->~InputType (); // arena-allocaed, so no destructor, but avoid UB.
@@ -35,13 +35,13 @@ struct ExpressionManipulator {
3535
3636 // Convenience method for nop, which is a common conversion
3737 template <typename InputType>
38- static Nop* nop (InputType* target) {
38+ inline Nop* nop (InputType* target) {
3939 return convert<InputType, Nop>(target);
4040 }
4141
4242 // Convert a node that allocates
4343 template <typename InputType, typename OutputType>
44- static OutputType* convert (InputType *input, MixedArena& allocator) {
44+ inline OutputType* convert (InputType *input, MixedArena& allocator) {
4545 assert (sizeof (OutputType) <= sizeof (InputType));
4646 input->~InputType (); // arena-allocaed, so no destructor, but avoid UB.
4747 OutputType* output = (OutputType*)(input);
@@ -50,18 +50,18 @@ struct ExpressionManipulator {
5050 }
5151
5252 using CustomCopier = std::function<Expression*(Expression*)>;
53- static Expression* flexibleCopy (Expression* original, Module& wasm, CustomCopier custom);
53+ Expression* flexibleCopy (Expression* original, Module& wasm, CustomCopier custom);
5454
55- static Expression* copy (Expression* original, Module& wasm) {
55+ inline Expression* copy (Expression* original, Module& wasm) {
5656 auto copy = [](Expression* curr) {
5757 return nullptr ;
5858 };
5959 return flexibleCopy (original, wasm, copy);
6060 }
6161
6262 // Splice an item into the middle of a block's list
63- static void spliceIntoBlock (Block* block, Index index, Expression* add);
64- };
63+ void spliceIntoBlock (Block* block, Index index, Expression* add);
64+ }
6565
6666} // wasm
6767
0 commit comments