summaryrefslogtreecommitdiffhomepage
path: root/src/CompilerKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-11 13:25:12 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-11 13:25:12 +0100
commit37b8e34dc54f572fbfbd135742fa11c21c5e67c1 (patch)
tree94a017be79eb83306ecc6c7ca2455a7e3e242b56 /src/CompilerKit
parent30a7184205b0cbf2dfc49ed3a52543219008dc32 (diff)
chore! breaking changes in NeCTI API.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/CompilerKit')
-rw-r--r--src/CompilerKit/src/CodeGenerator+AssemblyFactory.cc9
-rw-r--r--src/CompilerKit/src/Compilers/CCompiler+64x0.cc4
-rw-r--r--src/CompilerKit/src/Compilers/CCompiler+ARM64.cc4
-rw-r--r--src/CompilerKit/src/Compilers/CCompiler+Power64.cc4
-rw-r--r--src/CompilerKit/src/Compilers/CPlusPlusCompiler+AMD64.cc4
-rw-r--r--src/CompilerKit/src/DynamicLinkers/DynamicLinker64+PEF.cc4
6 files changed, 19 insertions, 10 deletions
diff --git a/src/CompilerKit/src/CodeGenerator+AssemblyFactory.cc b/src/CompilerKit/src/CodeGenerator+AssemblyFactory.cc
index 44e2484..b5da2a8 100644
--- a/src/CompilerKit/src/CodeGenerator+AssemblyFactory.cc
+++ b/src/CompilerKit/src/CodeGenerator+AssemblyFactory.cc
@@ -5,7 +5,6 @@
======================================== */
#include <CompilerKit/CodeGenerator.h>
-#include <CompilerKit/ErrorID.h>
/**
* @file AssemblyFactory.cc
@@ -32,20 +31,20 @@ Int32 AssemblyFactory::Compile(STLString sourceFile, const Int32& arch) noexcept
}
///! @brief mount assembly backend.
-void AssemblyFactory::Mount(IAssembly* mountPtr) noexcept {
+void AssemblyFactory::Mount(WeakRef<IAssembly> mountPtr) noexcept {
if (mountPtr) {
- fMounted = mountPtr;
+ fMounted = mountPtr.Leak();
}
}
///! @brief Unmount assembler.
-IAssembly* AssemblyFactory::Unmount() noexcept {
+WeakRef<IAssembly> AssemblyFactory::Unmount() noexcept {
auto mount_prev = fMounted;
if (fMounted) {
fMounted = nullptr;
}
- return mount_prev;
+ return WeakRef<IAssembly>{mount_prev};
}
} // namespace CompilerKit
diff --git a/src/CompilerKit/src/Compilers/CCompiler+64x0.cc b/src/CompilerKit/src/Compilers/CCompiler+64x0.cc
index 394f933..f18b22b 100644
--- a/src/CompilerKit/src/Compilers/CCompiler+64x0.cc
+++ b/src/CompilerKit/src/Compilers/CCompiler+64x0.cc
@@ -1191,7 +1191,9 @@ NECTI_MODULE(CompilerCLang64x0) {
bool skip = false;
- kFactory.Mount(new AssemblyCCInterface());
+ CompilerKit::StrongRef<AssemblyCCInterface> mntPnt{new AssemblyCCInterface()};
+
+ kFactory.Mount({mntPnt.Leak()});
kMachine = CompilerKit::AssemblyFactory::kArch64x0;
kCompilerFrontend = new CompilerFrontend64x0();
diff --git a/src/CompilerKit/src/Compilers/CCompiler+ARM64.cc b/src/CompilerKit/src/Compilers/CCompiler+ARM64.cc
index 7b99b70..e0f08e2 100644
--- a/src/CompilerKit/src/Compilers/CCompiler+ARM64.cc
+++ b/src/CompilerKit/src/Compilers/CCompiler+ARM64.cc
@@ -1190,7 +1190,9 @@ NECTI_MODULE(CompilerCLangARM64) {
bool skip = false;
- kFactory.Mount(new AssemblyCCInterface());
+ CompilerKit::StrongRef<AssemblyCCInterface> mntPnt{new AssemblyCCInterface()};
+
+ kFactory.Mount({mntPnt.Leak()});
kMachine = CompilerKit::AssemblyFactory::kArchAARCH64;
kCompilerFrontend = new CompilerFrontendARM64();
diff --git a/src/CompilerKit/src/Compilers/CCompiler+Power64.cc b/src/CompilerKit/src/Compilers/CCompiler+Power64.cc
index 993ee7c..724e7cc 100644
--- a/src/CompilerKit/src/Compilers/CCompiler+Power64.cc
+++ b/src/CompilerKit/src/Compilers/CCompiler+Power64.cc
@@ -1202,7 +1202,9 @@ NECTI_MODULE(CompilerCLangPowerPC) {
bool skip = false;
- kFactory.Mount(new AssemblyMountpointCLang());
+ CompilerKit::StrongRef<AssemblyMountpointCLang> mntPnt{new AssemblyMountpointCLang()};
+
+ kFactory.Mount({mntPnt.Leak()});
kMachine = CompilerKit::AssemblyFactory::kArchPowerPC;
kCompilerFrontend = new CompilerFrontendPower64();
diff --git a/src/CompilerKit/src/Compilers/CPlusPlusCompiler+AMD64.cc b/src/CompilerKit/src/Compilers/CPlusPlusCompiler+AMD64.cc
index 4f85f05..70de909 100644
--- a/src/CompilerKit/src/Compilers/CPlusPlusCompiler+AMD64.cc
+++ b/src/CompilerKit/src/Compilers/CPlusPlusCompiler+AMD64.cc
@@ -819,7 +819,9 @@ NECTI_MODULE(CompilerCPlusPlusAMD64) {
kErrorLimit = 0;
kFrontend = new CompilerFrontendCPlusPlusAMD64();
- kAssembler.Mount(new AssemblyCPlusPlusInterfaceAMD64());
+
+ CompilerKit::StrongRef<AssemblyCPlusPlusInterfaceAMD64> mntPnt{new AssemblyCPlusPlusInterfaceAMD64()};
+ kAssembler.Mount({mntPnt.Leak()});
CompilerKit::install_signal(SIGSEGV, CompilerKit::Detail::drvi_crash_handler);
diff --git a/src/CompilerKit/src/DynamicLinkers/DynamicLinker64+PEF.cc b/src/CompilerKit/src/DynamicLinkers/DynamicLinker64+PEF.cc
index 0fffa84..0361873 100644
--- a/src/CompilerKit/src/DynamicLinkers/DynamicLinker64+PEF.cc
+++ b/src/CompilerKit/src/DynamicLinkers/DynamicLinker64+PEF.cc
@@ -27,6 +27,8 @@
#define kPefNoCpu (0U)
#define kPefNoSubCpu (0U)
+#define kPefDefaultOutput {"a" kPefExt}
+
#define kLinkerDefaultOrigin kPefBaseOrigin
#define kLinkerId (0x5046FF)
#define kLinkerAbiContainer "__PEFContainer:ABI:"
@@ -48,7 +50,7 @@ enum {
kABITypeInvalid = 0xFFFF,
};
-static CompilerKit::STLString kOutput = "a" kPefExt;
+static CompilerKit::STLString kOutput = kPefDefaultOutput;
static Int32 kAbi = kABITypeNE;
static Int32 kSubArch = kPefNoSubCpu;
static Int32 kArch = CompilerKit::kPefArchInvalid;