diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-04-26 20:06:40 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-04-26 20:06:40 -0700 |
commit | 206338a6c4e3f9739abd7a2ad082d1770b3a628f (patch) | |
tree | 817992a1e811af71087a228b20f3c35df9485b96 /src/asm_v_wasm.h | |
parent | dd778824cfc60c4478bbe7690769f444dad92803 (diff) | |
parent | d9096704dfa84aea94bb6ac2ffa02d88fa546bfa (diff) | |
download | binaryen-206338a6c4e3f9739abd7a2ad082d1770b3a628f.tar.gz binaryen-206338a6c4e3f9739abd7a2ad082d1770b3a628f.tar.bz2 binaryen-206338a6c4e3f9739abd7a2ad082d1770b3a628f.zip |
Prep for arena vectors
Arena vectors
Diffstat (limited to 'src/asm_v_wasm.h')
-rw-r--r-- | src/asm_v_wasm.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/asm_v_wasm.h b/src/asm_v_wasm.h index 27acf3dcc..cfb4d44d5 100644 --- a/src/asm_v_wasm.h +++ b/src/asm_v_wasm.h @@ -33,15 +33,31 @@ std::string getSig(FunctionType *type); std::string getSig(Function *func); -std::string getSig(CallBase *call); +template<typename CallBase> +std::string getSig(CallBase *call) { + std::string ret; + ret += getSig(call->type); + for (auto operand : call->operands) { + ret += getSig(operand->type); + } + return ret; +} -std::string getSig(WasmType result, const ExpressionList& operands); +template<typename ListType> +std::string getSig(WasmType result, const ListType& operands) { + std::string ret; + ret += getSig(result); + for (auto operand : operands) { + ret += getSig(operand->type); + } + return ret; +} WasmType sigToWasmType(char sig); FunctionType sigToFunctionType(std::string sig); -FunctionType* ensureFunctionType(std::string sig, Module* wasm, MixedArena& allocator); +FunctionType* ensureFunctionType(std::string sig, Module* wasm); } // namespace wasm |