summaryrefslogtreecommitdiffhomepage
path: root/dev/LibCompiler/src
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-04-19 17:33:26 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-04-19 17:33:26 +0200
commitbefde76cfa46c766e81f74eb5ac65d3dae2dde87 (patch)
tree45b2f9fd6b3f9605c2747485bd24483192f99e73 /dev/LibCompiler/src
parent3afc481dc64a07fe7fcaff9ce7a12a492c3ec8e7 (diff)
dev, LibCompiler, tooling: refactor and separate components into modules
(cppdrv, cxxdrv) Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/LibCompiler/src')
-rw-r--r--dev/LibCompiler/src/Assembler32x0.cc6
-rw-r--r--dev/LibCompiler/src/Assembler64x0.cc6
-rw-r--r--dev/LibCompiler/src/AssemblerAMD64.cc6
-rw-r--r--dev/LibCompiler/src/AssemblerARM64.cc8
-rw-r--r--dev/LibCompiler/src/AssemblerPower.cc8
-rw-r--r--dev/LibCompiler/src/AssemblyFactory.cc4
-rw-r--r--dev/LibCompiler/src/CCompiler64x0.cc2
-rw-r--r--dev/LibCompiler/src/CCompilerARM64.cc2
-rw-r--r--dev/LibCompiler/src/CCompilerPower64.cc4
-rw-r--r--dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc12
-rw-r--r--dev/LibCompiler/src/CPlusPlusCompilerPreProcessor.cc4
-rw-r--r--dev/LibCompiler/src/Detail/AsmUtils.h2
-rw-r--r--dev/LibCompiler/src/Detail/ClUtils.h2
-rw-r--r--dev/LibCompiler/src/DynamicLinkerPEF.cc60
-rw-r--r--dev/LibCompiler/src/StringView.cc2
15 files changed, 64 insertions, 64 deletions
diff --git a/dev/LibCompiler/src/Assembler32x0.cc b/dev/LibCompiler/src/Assembler32x0.cc
index 0eaf78a..1790b8b 100644
--- a/dev/LibCompiler/src/Assembler32x0.cc
+++ b/dev/LibCompiler/src/Assembler32x0.cc
@@ -19,10 +19,10 @@
#define __ASM_NEED_32x0__ 1
-#include <LibCompiler/AAL/CPU/32x0.h>
+#include <LibCompiler/Backend/32x0.h>
#include <LibCompiler/Parser.h>
-#include <LibCompiler/NFC/AE.h>
-#include <LibCompiler/NFC/PEF.h>
+#include <LibCompiler/AE.h>
+#include <LibCompiler/PEF.h>
/////////////////////
diff --git a/dev/LibCompiler/src/Assembler64x0.cc b/dev/LibCompiler/src/Assembler64x0.cc
index b074e9f..7630adf 100644
--- a/dev/LibCompiler/src/Assembler64x0.cc
+++ b/dev/LibCompiler/src/Assembler64x0.cc
@@ -19,10 +19,10 @@
#define __ASM_NEED_64x0__ 1
-#include <LibCompiler/AAL/CPU/64x0.h>
+#include <LibCompiler/Backend/64x0.h>
#include <LibCompiler/Parser.h>
-#include <LibCompiler/NFC/AE.h>
-#include <LibCompiler/NFC/PEF.h>
+#include <LibCompiler/AE.h>
+#include <LibCompiler/PEF.h>
#include <algorithm>
#include <filesystem>
#include <fstream>
diff --git a/dev/LibCompiler/src/AssemblerAMD64.cc b/dev/LibCompiler/src/AssemblerAMD64.cc
index d71caf2..be77ce9 100644
--- a/dev/LibCompiler/src/AssemblerAMD64.cc
+++ b/dev/LibCompiler/src/AssemblerAMD64.cc
@@ -26,10 +26,10 @@
#define kAssemblerPragmaSymStr "#"
#define kAssemblerPragmaSym '#'
-#include <LibCompiler/AAL/CPU/amd64.h>
+#include <LibCompiler/Backend/amd64.h>
#include <LibCompiler/Parser.h>
-#include <LibCompiler/NFC/AE.h>
-#include <LibCompiler/NFC/PEF.h>
+#include <LibCompiler/AE.h>
+#include <LibCompiler/PEF.h>
#include <algorithm>
#include <cstdlib>
#include <filesystem>
diff --git a/dev/LibCompiler/src/AssemblerARM64.cc b/dev/LibCompiler/src/AssemblerARM64.cc
index e402b7f..52b78d6 100644
--- a/dev/LibCompiler/src/AssemblerARM64.cc
+++ b/dev/LibCompiler/src/AssemblerARM64.cc
@@ -17,11 +17,11 @@
#define __ASM_NEED_ARM64__ 1
-#include <LibCompiler/NFC/ErrorID.h>
-#include <LibCompiler/AAL/CPU/arm64.h>
-#include <LibCompiler/NFC/PEF.h>
+#include <LibCompiler/ErrorID.h>
+#include <LibCompiler/Backend/arm64.h>
+#include <LibCompiler/PEF.h>
#include <LibCompiler/Parser.h>
-#include <LibCompiler/NFC/AE.h>
+#include <LibCompiler/AE.h>
#include <LibCompiler/Version.h>
#include <filesystem>
#include <algorithm>
diff --git a/dev/LibCompiler/src/AssemblerPower.cc b/dev/LibCompiler/src/AssemblerPower.cc
index 7cb4ca0..59f7ed6 100644
--- a/dev/LibCompiler/src/AssemblerPower.cc
+++ b/dev/LibCompiler/src/AssemblerPower.cc
@@ -17,11 +17,11 @@
#define __ASM_NEED_PPC__ 1
-#include <LibCompiler/NFC/ErrorID.h>
-#include <LibCompiler/AAL/CPU/power64.h>
-#include <LibCompiler/NFC/PEF.h>
+#include <LibCompiler/ErrorID.h>
+#include <LibCompiler/Backend/power64.h>
+#include <LibCompiler/PEF.h>
#include <LibCompiler/Parser.h>
-#include <LibCompiler/NFC/AE.h>
+#include <LibCompiler/AE.h>
#include <LibCompiler/Version.h>
#include <filesystem>
#include <algorithm>
diff --git a/dev/LibCompiler/src/AssemblyFactory.cc b/dev/LibCompiler/src/AssemblyFactory.cc
index 46ebed3..e70f279 100644
--- a/dev/LibCompiler/src/AssemblyFactory.cc
+++ b/dev/LibCompiler/src/AssemblyFactory.cc
@@ -4,8 +4,8 @@
------------------------------------------- */
-#include <LibCompiler/AAL/AssemblyInterface.h>
-#include <LibCompiler/NFC/ErrorID.h>
+#include <LibCompiler/AssemblyInterface.h>
+#include <LibCompiler/ErrorID.h>
/**
* @file AssemblyFactory.cxx
diff --git a/dev/LibCompiler/src/CCompiler64x0.cc b/dev/LibCompiler/src/CCompiler64x0.cc
index 19446af..89fc682 100644
--- a/dev/LibCompiler/src/CCompiler64x0.cc
+++ b/dev/LibCompiler/src/CCompiler64x0.cc
@@ -10,7 +10,7 @@
/// BUGS: 0
/// TODO: none
-#include <LibCompiler/AAL/CPU/64x0.h>
+#include <LibCompiler/Backend/64x0.h>
#include <LibCompiler/Parser.h>
#include <LibCompiler/UUID.h>
#include <cstdio>
diff --git a/dev/LibCompiler/src/CCompilerARM64.cc b/dev/LibCompiler/src/CCompilerARM64.cc
index ac09cbd..5d3e892 100644
--- a/dev/LibCompiler/src/CCompilerARM64.cc
+++ b/dev/LibCompiler/src/CCompilerARM64.cc
@@ -10,7 +10,7 @@
/// BUGS: 0
/// TODO: none
-#include <LibCompiler/AAL/CPU/arm64.h>
+#include <LibCompiler/Backend/arm64.h>
#include <LibCompiler/Parser.h>
#include <LibCompiler/UUID.h>
#include <cstdio>
diff --git a/dev/LibCompiler/src/CCompilerPower64.cc b/dev/LibCompiler/src/CCompilerPower64.cc
index 63b2794..ac35c4a 100644
--- a/dev/LibCompiler/src/CCompilerPower64.cc
+++ b/dev/LibCompiler/src/CCompilerPower64.cc
@@ -7,7 +7,7 @@
* ========================================================
*/
-#include <LibCompiler/AAL/CPU/power64.h>
+#include <LibCompiler/Backend/power64.h>
#include <LibCompiler/Parser.h>
#include <LibCompiler/UUID.h>
#include <fstream>
@@ -21,7 +21,7 @@
#define kExitOK 0
-/// @author EL Mahrouss Amlal (amlel)
+/// @author EL Mahrouss Amlal (amlal@nekernel.org)
/// @file cc.cxx
/// @brief POWER64 C Compiler.
diff --git a/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc b/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc
index 96a2873..c053920 100644
--- a/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc
+++ b/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc
@@ -19,7 +19,7 @@
// extern_segment, @autodelete { ... }, fn foo() -> auto { ... }
-#include <LibCompiler/AAL/CPU/amd64.h>
+#include <LibCompiler/Backend/amd64.h>
#include <LibCompiler/Parser.h>
#include <LibCompiler/UUID.h>
@@ -1078,27 +1078,27 @@ LIBCOMPILER_MODULE(CompilerCPlusPlusAMD64)
continue;
}
- if (strcmp(argv[index], "--cl:version") == 0)
+ if (strcmp(argv[index], "-version") == 0)
{
kSplashCxx();
return kExitOK;
}
- if (strcmp(argv[index], "--cl:verbose") == 0)
+ if (strcmp(argv[index], "-cxx-verbose") == 0)
{
kState.fVerbose = true;
continue;
}
- if (strcmp(argv[index], "--cl:h") == 0)
+ if (strcmp(argv[index], "-h") == 0)
{
cxx_print_help();
return kExitOK;
}
- if (strcmp(argv[index], "--cl:c++-dialect") == 0)
+ if (strcmp(argv[index], "-cxx-dialect") == 0)
{
if (kCompilerFrontend)
std::cout << kCompilerFrontend->Language() << "\n";
@@ -1106,7 +1106,7 @@ LIBCOMPILER_MODULE(CompilerCPlusPlusAMD64)
return kExitOK;
}
- if (strcmp(argv[index], "--cl:max-err") == 0)
+ if (strcmp(argv[index], "-max-err") == 0)
{
try
{
diff --git a/dev/LibCompiler/src/CPlusPlusCompilerPreProcessor.cc b/dev/LibCompiler/src/CPlusPlusCompilerPreProcessor.cc
index 6a4e9cd..336ca5a 100644
--- a/dev/LibCompiler/src/CPlusPlusCompilerPreProcessor.cc
+++ b/dev/LibCompiler/src/CPlusPlusCompilerPreProcessor.cc
@@ -10,7 +10,7 @@
/// BUGS: 0
#include <LibCompiler/Parser.h>
-#include <LibCompiler/NFC/ErrorID.h>
+#include <LibCompiler/ErrorID.h>
#include <algorithm>
#include <filesystem>
#include <fstream>
@@ -419,7 +419,7 @@ void bpp_parse_file(std::ifstream& hdr_file, std::ofstream& pp_out)
}
else
{
- throw std::runtime_error("internal: Internal C++ error. (Please report that bug.)");
+ throw std::runtime_error("bpp: Internal error.");
}
}
diff --git a/dev/LibCompiler/src/Detail/AsmUtils.h b/dev/LibCompiler/src/Detail/AsmUtils.h
index 29dbcbe..997564c 100644
--- a/dev/LibCompiler/src/Detail/AsmUtils.h
+++ b/dev/LibCompiler/src/Detail/AsmUtils.h
@@ -6,7 +6,7 @@
#pragma once
-#include <LibCompiler/AAL/AssemblyInterface.h>
+#include <LibCompiler/AssemblyInterface.h>
#include <LibCompiler/Parser.h>
using namespace LibCompiler;
diff --git a/dev/LibCompiler/src/Detail/ClUtils.h b/dev/LibCompiler/src/Detail/ClUtils.h
index aa1e0f6..fe788a2 100644
--- a/dev/LibCompiler/src/Detail/ClUtils.h
+++ b/dev/LibCompiler/src/Detail/ClUtils.h
@@ -6,7 +6,7 @@
#pragma once
-#include <LibCompiler/AAL/AssemblyInterface.h>
+#include <LibCompiler/AssemblyInterface.h>
#include <LibCompiler/Parser.h>
#define kZero64Section ".zero64"
diff --git a/dev/LibCompiler/src/DynamicLinkerPEF.cc b/dev/LibCompiler/src/DynamicLinkerPEF.cc
index 22f268c..6410885 100644
--- a/dev/LibCompiler/src/DynamicLinkerPEF.cc
+++ b/dev/LibCompiler/src/DynamicLinkerPEF.cc
@@ -7,28 +7,28 @@
------------------------------------------- */
-/// @author EL Mahrouss Amlal (amlel)
+/// @author EL Mahrouss Amlal (amlal@nekernel.org)
/// @brief NeKernel 64-bit PEF Linker.
-/// Last Rev: Sat Feb 24 CET 2024
+/// Last Rev: Sat Apr 19 CET 2025
/// @note Do not look up for anything with .code64/.data64/.zero64!
/// It will be loaded when the program loader will start the image.
//! Toolchain Kit.
#include <LibCompiler/Defines.h>
-#include <LibCompiler/NFC/ErrorID.h>
+#include <LibCompiler/ErrorID.h>
//! Assembler Kit
-#include <LibCompiler/AAL/AssemblyInterface.h>
+#include <LibCompiler/AssemblyInterface.h>
//! Preferred Executable Format
-#include <LibCompiler/NFC/PEF.h>
+#include <LibCompiler/PEF.h>
#include <LibCompiler/UUID.h>
//! Release macros.
#include <LibCompiler/Version.h>
//! Advanced Executable Object Format.
-#include <LibCompiler/NFC/AE.h>
+#include <LibCompiler/AE.h>
#include <cstdint>
#define kLinkerVersionStr "\e[0;97m NeKernel 64-Bit Linker (Preferred Executable) %s, (c) Amlal El Mahrouss 2024-2025, all rights reserved.\n"
@@ -100,79 +100,79 @@ LIBCOMPILER_MODULE(DynamicLinker64PEF)
*/
for (size_t linker_arg = 1; linker_arg < argc; ++linker_arg)
{
- if (StringCompare(argv[linker_arg], "--ld64:help") == 0)
+ if (StringCompare(argv[linker_arg], "-help") == 0)
{
kLinkerSplash();
- kStdOut << "--ld64:version: Show linker version.\n";
- kStdOut << "--ld64:help: Show linker help.\n";
- kStdOut << "--ld64:verbose: Enable linker trace.\n";
- kStdOut << "--ld64:dylib: Output as a Dyanmic PEF.\n";
- kStdOut << "--ld64:fat: Output as a FAT PEF.\n";
- kStdOut << "--ld64:32k: Output as a 32x0 PEF.\n";
- kStdOut << "--ld64:64k: Output as a 64x0 PEF.\n";
- kStdOut << "--ld64:amd64: Output as a AMD64 PEF.\n";
- kStdOut << "--ld64:rv64: Output as a RISC-V PEF.\n";
- kStdOut << "--ld64:power64: Output as a POWER PEF.\n";
- kStdOut << "--ld64:arm64: Output as a ARM64 PEF.\n";
- kStdOut << "--ld64:output: Select the output file name.\n";
+ kStdOut << "-version: Show linker version.\n";
+ kStdOut << "-help: Show linker help.\n";
+ kStdOut << "-ld-verbose: Enable linker trace.\n";
+ kStdOut << "-dylib: Output as a Dyanmic PEF.\n";
+ kStdOut << "-fat: Output as a FAT PEF.\n";
+ kStdOut << "-32k: Output as a 32x0 PEF.\n";
+ kStdOut << "-64k: Output as a 64x0 PEF.\n";
+ kStdOut << "-amd64: Output as a AMD64 PEF.\n";
+ kStdOut << "-rv64: Output as a RISC-V PEF.\n";
+ kStdOut << "-power64: Output as a POWER PEF.\n";
+ kStdOut << "-arm64: Output as a ARM64 PEF.\n";
+ kStdOut << "-output: Select the output file name.\n";
return EXIT_SUCCESS;
}
- else if (StringCompare(argv[linker_arg], "--ld64:version") == 0)
+ else if (StringCompare(argv[linker_arg], "-version") == 0)
{
kLinkerSplash();
return EXIT_SUCCESS;
}
- else if (StringCompare(argv[linker_arg], "--ld64:fat-binary") == 0)
+ else if (StringCompare(argv[linker_arg], "-fat-binary") == 0)
{
kFatBinaryEnable = true;
continue;
}
- else if (StringCompare(argv[linker_arg], "--ld64:64k") == 0)
+ else if (StringCompare(argv[linker_arg], "-64k") == 0)
{
kArch = LibCompiler::kPefArch64000;
continue;
}
- else if (StringCompare(argv[linker_arg], "--ld64:amd64") == 0)
+ else if (StringCompare(argv[linker_arg], "-amd64") == 0)
{
kArch = LibCompiler::kPefArchAMD64;
continue;
}
- else if (StringCompare(argv[linker_arg], "--ld64:32k") == 0)
+ else if (StringCompare(argv[linker_arg], "-32k") == 0)
{
kArch = LibCompiler::kPefArch32000;
continue;
}
- else if (StringCompare(argv[linker_arg], "--ld64:power64") == 0)
+ else if (StringCompare(argv[linker_arg], "-power64") == 0)
{
kArch = LibCompiler::kPefArchPowerPC;
continue;
}
- else if (StringCompare(argv[linker_arg], "--ld64:riscv64") == 0)
+ else if (StringCompare(argv[linker_arg], "-riscv64") == 0)
{
kArch = LibCompiler::kPefArchRISCV;
continue;
}
- else if (StringCompare(argv[linker_arg], "--ld64:arm64") == 0)
+ else if (StringCompare(argv[linker_arg], "-arm64") == 0)
{
kArch = LibCompiler::kPefArchARM64;
continue;
}
- else if (StringCompare(argv[linker_arg], "--ld64:verbose") == 0)
+ else if (StringCompare(argv[linker_arg], "-ld-verbose") == 0)
{
kVerbose = true;
continue;
}
- else if (StringCompare(argv[linker_arg], "--ld64:dylib") == 0)
+ else if (StringCompare(argv[linker_arg], "-dylib") == 0)
{
if (kOutput.empty())
{
@@ -188,7 +188,7 @@ LIBCOMPILER_MODULE(DynamicLinker64PEF)
continue;
}
- else if (StringCompare(argv[linker_arg], "--ld64:output") == 0)
+ else if (StringCompare(argv[linker_arg], "-output") == 0)
{
if ((linker_arg + 1) > argc)
continue;
diff --git a/dev/LibCompiler/src/StringView.cc b/dev/LibCompiler/src/StringView.cc
index 30f1b5f..a3bbb4c 100644
--- a/dev/LibCompiler/src/StringView.cc
+++ b/dev/LibCompiler/src/StringView.cc
@@ -18,7 +18,7 @@
*
*/
-#include <LibCompiler/NFC/StringView.h>
+#include <LibCompiler/StringView.h>
namespace LibCompiler
{