diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-05 16:48:25 -0500 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-05 16:48:25 -0500 |
| commit | 6decb96948f61b9a311467ecdb621a048fbcd3d6 (patch) | |
| tree | 247d8b92e42068b53e2ebbeccb21e31a545ecd30 /include | |
| parent | 037ac38824623c13070384e8fc0e70c4770dcdbd (diff) | |
chore: CompilerKit breaking changes.v0.0.81
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/CompilerKit/CodeGenerator.h | 18 | ||||
| -rw-r--r-- | include/CompilerKit/Ref.h | 2 | ||||
| -rw-r--r-- | include/CompilerKit/Utilities/Assembler.h | 10 | ||||
| -rw-r--r-- | include/CompilerKit/Utilities/Compiler.h | 2 | ||||
| -rw-r--r-- | include/LibC++/__abi+unreachable.inl | 16 | ||||
| -rw-r--r-- | include/LibC++/__abi.h | 9 |
6 files changed, 25 insertions, 32 deletions
diff --git a/include/CompilerKit/CodeGenerator.h b/include/CompilerKit/CodeGenerator.h index 383f170..79b185b 100644 --- a/include/CompilerKit/CodeGenerator.h +++ b/include/CompilerKit/CodeGenerator.h @@ -10,12 +10,12 @@ #include <CompilerKit/Macros.h> #include <cstring> -#define CK_ASSEMBLY_INTERFACE : public ::CompilerKit::AssemblyInterface +#define CK_ASSEMBLY_INTERFACE : public ::CompilerKit::IAssembly #define CK_ENCODER : public ::CompilerKit::EncoderInterface namespace CompilerKit { class AssemblyFactory; -class AssemblyInterface; +class IAssembly; /// =========================================================== /// /// @brief Simple assembly factory @@ -42,23 +42,23 @@ class AssemblyFactory final { Int32 Compile(std::string sourceFile, const Int32& arch) noexcept; - void Mount(AssemblyInterface* mountPtr) noexcept; - AssemblyInterface* Unmount() noexcept; + void Mount(IAssembly* mountPtr) noexcept; + IAssembly* Unmount() noexcept; private: - AssemblyInterface* fMounted{nullptr}; + IAssembly* fMounted{nullptr}; }; /// =========================================================== /// /// @brief Assembly to binary generator class. /// @note This interface creates according to the CPU target of the child class. /// =========================================================== /// -class AssemblyInterface { +class IAssembly { public: - explicit AssemblyInterface() = default; - virtual ~AssemblyInterface() = default; + explicit IAssembly() = default; + virtual ~IAssembly() = default; - NECTI_COPY_DEFAULT(AssemblyInterface); + NECTI_COPY_DEFAULT(IAssembly); virtual UInt32 Arch() noexcept { return AssemblyFactory::kArchAMD64; } diff --git a/include/CompilerKit/Ref.h b/include/CompilerKit/Ref.h index 863a100..72e9472 100644 --- a/include/CompilerKit/Ref.h +++ b/include/CompilerKit/Ref.h @@ -18,7 +18,7 @@ namespace CompilerKit { template <typename T> class Ref final { public: - explicit Ref() = default; + Ref() = default; ~Ref() { if (m_Strong) { diff --git a/include/CompilerKit/Utilities/Assembler.h b/include/CompilerKit/Utilities/Assembler.h index fc965f0..afe95d1 100644 --- a/include/CompilerKit/Utilities/Assembler.h +++ b/include/CompilerKit/Utilities/Assembler.h @@ -10,13 +10,14 @@ #include <CompilerKit/CodeGenerator.h> #include <CompilerKit/Utilities/Compiler.h> -using namespace CompilerKit; - +namespace CompilerKit { /// @brief Get Number from lineBuffer. /// @param lineBuffer the lineBuffer to fetch from. /// @param numberKey where to seek that number. /// @return A numbercast of 32-bit width. -static NumberCast32 GetNumber32(STLString lineBuffer, STLString numberKey) { +inline NumberCast32 GetNumber32(STLString lineBuffer, STLString numberKey) { + if (lineBuffer.empty()) return {}; + auto pos = lineBuffer.find(numberKey) + numberKey.size(); while (lineBuffer[pos] == ' ') { @@ -83,10 +84,11 @@ static NumberCast32 GetNumber32(STLString lineBuffer, STLString numberKey) { NumberCast32 numOffset(strtol(lineBuffer.substr(pos).c_str(), nullptr, 10)); if (kVerbose) { - kStdOut << "asm: found a base 10 number here:" << lineBuffer.substr(pos) << "\n"; + kStdOut << "asm: found a base 10 number here:" << lineBuffer.substr(pos) << kStdEndl; } return numOffset; } } } +} // namespace CompilerKit
\ No newline at end of file diff --git a/include/CompilerKit/Utilities/Compiler.h b/include/CompilerKit/Utilities/Compiler.h index bbca020..41b7771 100644 --- a/include/CompilerKit/Utilities/Compiler.h +++ b/include/CompilerKit/Utilities/Compiler.h @@ -28,7 +28,7 @@ #define kStdOut (std::cout << kRed << "drv: " << kWhite) #define kStdErr (std::cerr << kYellow << "drv: " << kWhite) - +#define kStdEndl std::endl #define kPrintF kStdOut #define kPrintErr kStdErr diff --git a/include/LibC++/__abi+unreachable.inl b/include/LibC++/__abi+unreachable.inl deleted file mode 100644 index 5628e7d..0000000 --- a/include/LibC++/__abi+unreachable.inl +++ /dev/null @@ -1,16 +0,0 @@ -/* ======================================== - - Copyright (C) 2025 Amlal El Mahrouss, Licensed under the Apache 2.0 license. - -======================================== */ - -#include <LibC++/__abi.h> -#include <LibC++/base_process.h> - -static const int32_t __unreachable_code = 34; - -extern "C" void __compilerkit_unreachable(void) { - std::base_process::signal(__unreachable_code); - - while (1); -}
\ No newline at end of file diff --git a/include/LibC++/__abi.h b/include/LibC++/__abi.h index 206b5ef..6b4b058 100644 --- a/include/LibC++/__abi.h +++ b/include/LibC++/__abi.h @@ -7,9 +7,16 @@ #pragma once #include <LibC++/defines.h> +#include <LibC++/base_process.h> __init_decl() - extern void __compilerkit_unreachable(void); +static constexpr int32_t __unreachable_code = 34; + +inline void __compilerkit_unreachable(void) { + std::base_process::signal(__unreachable_code); + + while (1); +} __fini_decl()
\ No newline at end of file |
