#pragma once #include "chunk.h" #include #include #include #include #include #include using AsmArgs = std::vector; // 0th element is mnemonic using FactoryFunction = std::function(AsmArgs&)>; bool registerOp(const std::string& mnemonic, FactoryFunction f); template std::string mangleNameOne(const std::string& s) { return s + "_" + typeid(T).name(); } template std::string mangleName(const std::string& s) { if constexpr (sizeof...(Targs) == 0) return mangleNameOne(s); else return mangleName(s + "_" + typeid(T).name()); }