diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-12 08:29:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-12 08:29:40 +0200 |
| commit | 1ddeab9a4426abd781a5066ba79af2ba64de11d9 (patch) | |
| tree | 06155b0e26fcc2a9fc2d8e684155f82ded3d1552 /dev/LibCompiler/AssemblyInterface.h | |
| parent | 87979899ce833ca477bb563b84e3698224119dab (diff) | |
| parent | 2be9a150bb742987330c6de4dac23d4d2efb1ebe (diff) | |
Merge pull request #5 from nekernel-org/dev
0.0.1e2
Diffstat (limited to 'dev/LibCompiler/AssemblyInterface.h')
| -rw-r--r-- | dev/LibCompiler/AssemblyInterface.h | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/dev/LibCompiler/AssemblyInterface.h b/dev/LibCompiler/AssemblyInterface.h index 5450f84..b612962 100644 --- a/dev/LibCompiler/AssemblyInterface.h +++ b/dev/LibCompiler/AssemblyInterface.h @@ -13,19 +13,8 @@ #define ASSEMBLY_INTERFACE : public LibCompiler::AssemblyInterface namespace LibCompiler { -/// @brief Assembly to binary generator class. -/// @note This interface creates according to the CPU target of the child class. -class AssemblyInterface { - public: - explicit AssemblyInterface() = default; - virtual ~AssemblyInterface() = default; - - LIBCOMPILER_COPY_DEFAULT(AssemblyInterface); - - /// @brief compile to object file. - /// @note Example C++ -> MASM -> AE object. - virtual Int32 CompileToFormat(std::string src, Int32 arch) = 0; -}; +class AssemblyFactory; +class AssemblyInterface; /// @brief Simple assembly factory class AssemblyFactory final { @@ -37,7 +26,8 @@ class AssemblyFactory final { public: enum { - kArchAMD64, + kArchInvalid = 0, + kArchAMD64 = 100, kArch32x0, kArch64x0, kArchRISCV, @@ -55,6 +45,22 @@ class AssemblyFactory final { AssemblyInterface* fMounted{nullptr}; }; +/// @brief Assembly to binary generator class. +/// @note This interface creates according to the CPU target of the child class. +class AssemblyInterface { + public: + explicit AssemblyInterface() = default; + virtual ~AssemblyInterface() = default; + + LIBCOMPILER_COPY_DEFAULT(AssemblyInterface); + + [[maybe_unused]] virtual Int32 Arch() noexcept { return AssemblyFactory::kArchAMD64; } + + /// @brief compile to object file. + /// @note Example C++ -> MASM -> AE object. + virtual Int32 CompileToFormat(std::string src, Int32 arch) = 0; +}; + union NumberCastBase { NumberCastBase() = default; ~NumberCastBase() = default; |
