From 1349c00b782eca3ea841bfa388301cb6fc908cc7 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 18 Oct 2020 20:39:56 +0200 Subject: Namespace Asm --- asm/assembler.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'asm/assembler.h') 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 #include -// TODO: namespace Asm, e.g. AsmArgs -> Asm::Args +namespace Asm { -class AsmArgs: public std::vector +class Args: public std::vector { public: - AsmArgs(){} - AsmArgs(const std::vector& args): std::vector(args){} + Args(){} + Args(const std::vector& args): std::vector(args){} class Immediate8 { @@ -88,14 +88,16 @@ public: }; -using FactoryFunction = std::function(AsmArgs&)>; +} // namespace Asm + +using FactoryFunction = std::function(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 makeOp(const std::string& mnemonic, AsmArgs& args); +std::shared_ptr makeOp(const std::string& mnemonic, Asm::Args& args); // overload for empty list of arguments std::shared_ptr makeOp(const std::string& mnemonic); @@ -118,5 +120,5 @@ std::string mangleName(const std::string& s) return mangleName(s + "_" + typeid(T).name()); } -std::string mangleName(const std::string& s, AsmArgs& args); +std::string mangleName(const std::string& s, Asm::Args& args); -- cgit v1.2.3