diff options
Diffstat (limited to 'asm/assembler.h')
-rw-r--r-- | asm/assembler.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/asm/assembler.h b/asm/assembler.h index 52c3da5..f301d60 100644 --- a/asm/assembler.h +++ b/asm/assembler.h @@ -12,13 +12,13 @@ #include <unordered_map> #include <vector> -// TODO: namespace Asm, e.g. AsmArgs -> Asm::Args +namespace Asm { -class AsmArgs: public std::vector<std::any> +class Args: public std::vector<std::any> { public: - AsmArgs(){} - AsmArgs(const std::vector<std::any>& args): std::vector<std::any>(args){} + Args(){} + Args(const std::vector<std::any>& args): std::vector<std::any>(args){} class Immediate8 { @@ -88,14 +88,16 @@ public: }; -using FactoryFunction = std::function<std::shared_ptr<Op>(AsmArgs&)>; +} // namespace Asm + +using FactoryFunction = std::function<std::shared_ptr<Op>(Asm::Args&)>; // mnemonic: mnemonic including argument types bool registerOp(const std::string& mnemonic, FactoryFunction f); // Create Op from a registered mnemonic // mnemonic: just the mnemonic name -std::shared_ptr<Op> makeOp(const std::string& mnemonic, AsmArgs& args); +std::shared_ptr<Op> makeOp(const std::string& mnemonic, Asm::Args& args); // overload for empty list of arguments std::shared_ptr<Op> makeOp(const std::string& mnemonic); @@ -118,5 +120,5 @@ std::string mangleName(const std::string& s) return mangleName<Targs...>(s + "_" + typeid(T).name()); } -std::string mangleName(const std::string& s, AsmArgs& args); +std::string mangleName(const std::string& s, Asm::Args& args); |