summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-17 08:30:00 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-17 08:30:00 +0100
commit80de28e3472613e8f6aa8b2730d56b5307f4fb9a (patch)
tree7799e7dfc8b463adba33a87852dd8ea17dec8fa3
parent745bf42b74b6d9b1f6385c785b31a8734cfb4509 (diff)
chore: Improved assembler backends.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
-rw-r--r--include/CompilerKit/CodeGenerator.h2
-rw-r--r--include/CompilerKit/Detail/Config.h2
-rw-r--r--include/CompilerKit/Ref.h6
-rw-r--r--include/DebuggerKit/POSIXMachContract.h2
-rw-r--r--src/CompilerKit/ck-posix.json3
-rw-r--r--src/CompilerKit/src/Assemblers/Assembler+ARM64.cc2
-rw-r--r--src/CompilerKit/src/Assemblers/Assembler+PowerPC.cc4
-rw-r--r--src/CompilerKit/src/Compilers/CPlusPlusCompiler+AMD64.cc3
8 files changed, 13 insertions, 11 deletions
diff --git a/include/CompilerKit/CodeGenerator.h b/include/CompilerKit/CodeGenerator.h
index 36663ca..f2875bf 100644
--- a/include/CompilerKit/CodeGenerator.h
+++ b/include/CompilerKit/CodeGenerator.h
@@ -46,7 +46,7 @@ class AssemblyFactory final {
Int32 Compile(STLString sourceFile, const Int32& arch) noexcept;
- void Mount(WeakRef<IAssembly> mountPtr) noexcept;
+ void Mount(WeakRef<IAssembly> mountPtr) noexcept;
WeakRef<IAssembly> Unmount() noexcept;
private:
diff --git a/include/CompilerKit/Detail/Config.h b/include/CompilerKit/Detail/Config.h
index 3935fa3..79bc7fc 100644
--- a/include/CompilerKit/Detail/Config.h
+++ b/include/CompilerKit/Detail/Config.h
@@ -64,4 +64,4 @@ inline bool install_signal(Int32 signal, void (*handler)(int)) noexcept {
}
} // namespace CompilerKit
-#endif // __COMPILERKIT_CONFIG_H__ \ No newline at end of file
+#endif // __COMPILERKIT_CONFIG_H__ \ No newline at end of file
diff --git a/include/CompilerKit/Ref.h b/include/CompilerKit/Ref.h
index 3dee0c0..4063508 100644
--- a/include/CompilerKit/Ref.h
+++ b/include/CompilerKit/Ref.h
@@ -38,7 +38,7 @@ class StrongRef {
public:
StrongRef(Type* cls) : m_Class(cls), m_Strong(true) {}
- StrongRef& operator=(Type *ref) {
+ StrongRef& operator=(Type* ref) {
m_Class = ref;
return *this;
}
@@ -62,7 +62,7 @@ class StrongRef {
template <typename T>
class WeakRef final : public StrongRef<T> {
public:
- WeakRef() = delete;
+ WeakRef() = delete;
~WeakRef() = default;
NECTI_COPY_DEFAULT(WeakRef)
@@ -94,5 +94,5 @@ class NonNullRef final {
};
using StrongAny = StrongRef<VoidPtr>;
-using WeakAny = WeakRef<VoidPtr>;
+using WeakAny = WeakRef<VoidPtr>;
} // namespace CompilerKit
diff --git a/include/DebuggerKit/POSIXMachContract.h b/include/DebuggerKit/POSIXMachContract.h
index 054b935..a8cba12 100644
--- a/include/DebuggerKit/POSIXMachContract.h
+++ b/include/DebuggerKit/POSIXMachContract.h
@@ -67,7 +67,7 @@ class POSIXMachContract final DK_DEBUGGER_CONTRACT {
}
m_path = path;
- mPid = pid;
+ mPid = pid;
pid = this->mPid;
diff --git a/src/CompilerKit/ck-posix.json b/src/CompilerKit/ck-posix.json
index 6380ae2..f0a4a72 100644
--- a/src/CompilerKit/ck-posix.json
+++ b/src/CompilerKit/ck-posix.json
@@ -20,5 +20,6 @@
"__NECTAR__=202505",
"CK_USE_STRUCTS=1",
"kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)"
- ]
+ ],
+ "run_after_build": true
}
diff --git a/src/CompilerKit/src/Assemblers/Assembler+ARM64.cc b/src/CompilerKit/src/Assemblers/Assembler+ARM64.cc
index 3df2b03..f5174aa 100644
--- a/src/CompilerKit/src/Assemblers/Assembler+ARM64.cc
+++ b/src/CompilerKit/src/Assemblers/Assembler+ARM64.cc
@@ -43,7 +43,7 @@
#define kWhite "\e[0;97m"
#define kYellow "\e[0;33m"
-constexpr auto cPowerIPAlignment = 0x1U;
+constexpr auto kArm64Alignment = 0x1U;
static Char kOutputArch = CompilerKit::kPefArchARM64;
diff --git a/src/CompilerKit/src/Assemblers/Assembler+PowerPC.cc b/src/CompilerKit/src/Assemblers/Assembler+PowerPC.cc
index d595731..a61de04 100644
--- a/src/CompilerKit/src/Assemblers/Assembler+PowerPC.cc
+++ b/src/CompilerKit/src/Assemblers/Assembler+PowerPC.cc
@@ -43,7 +43,7 @@
#define kWhite "\e[0;97m"
#define kYellow "\e[0;33m"
-constexpr auto cPowerIPAlignment = 0x4U;
+constexpr auto kPowerIPAlignment = 0x1U;
static Char kOutputArch = CompilerKit::kPefArchPowerPC;
@@ -904,7 +904,7 @@ bool CompilerKit::EncoderPowerPC::WriteLine(std::string line, std::string file)
}
}
- kOrigin += cPowerIPAlignment;
+ kOrigin += kPowerIPAlignment;
break;
}
}
diff --git a/src/CompilerKit/src/Compilers/CPlusPlusCompiler+AMD64.cc b/src/CompilerKit/src/Compilers/CPlusPlusCompiler+AMD64.cc
index 54fbc25..7f92ef6 100644
--- a/src/CompilerKit/src/Compilers/CPlusPlusCompiler+AMD64.cc
+++ b/src/CompilerKit/src/Compilers/CPlusPlusCompiler+AMD64.cc
@@ -820,7 +820,8 @@ NECTI_MODULE(CompilerCPlusPlusAMD64) {
kFrontend = new CompilerFrontendCPlusPlusAMD64();
- CompilerKit::StrongRef<AssemblyCPlusPlusInterfaceAMD64> mntPnt{new AssemblyCPlusPlusInterfaceAMD64()};
+ CompilerKit::StrongRef<AssemblyCPlusPlusInterfaceAMD64> mntPnt{
+ new AssemblyCPlusPlusInterfaceAMD64()};
kAssembler.Mount({mntPnt.Leak()});
CompilerKit::install_signal(SIGSEGV, CompilerKit::Detail::drvi_crash_handler);