diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-22 10:25:39 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-22 10:25:39 +0200 |
| commit | 8ad58a91a11380203c4a81fe4dc93e7734631b32 (patch) | |
| tree | 33278ad442e5f20c88c2701a3cb5dcbfd7d3f589 /dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc | |
| parent | ca022f27844a5475dab608bd1970c05494a67290 (diff) | |
refactor: Reworking the code base, for the C++Drv, and ARM64 assembler.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc')
| -rw-r--r-- | dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc b/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc index e07029b..cc6fa67 100644 --- a/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc +++ b/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc @@ -123,7 +123,7 @@ static Boolean kInBraces = false; static size_t kBracesCount = 0UL; /* @brief C++ compiler backend for the NeKernel C++ driver */ -class CompilerFrontendCPlusPlus final : public LibCompiler::ICompilerFrontend { +class CompilerFrontendCPlusPlus final : public LibCompiler::CompilerFrontendInterface { public: explicit CompilerFrontendCPlusPlus() = default; ~CompilerFrontendCPlusPlus() override = default; @@ -710,7 +710,7 @@ Boolean CompilerFrontendCPlusPlus::Compile(std::string text, std::string file) { ///////////////////////////////////////////////////////////////////////////////////////// -class AssemblyCPlusPlusInterface final ASSEMBLY_INTERFACE { +class AssemblyCPlusPlusInterface final LC_ASSEMBLY_INTERFACE { public: explicit AssemblyCPlusPlusInterface() = default; ~AssemblyCPlusPlusInterface() override = default; @@ -723,7 +723,7 @@ class AssemblyCPlusPlusInterface final ASSEMBLY_INTERFACE { if (kCompilerFrontend == nullptr) return kExitNO; std::string dest = src; - dest += ".masm"; + dest += ".pp.masm"; std::ofstream out_fp(dest); @@ -883,11 +883,11 @@ LIBCOMPILER_MODULE(CompilerCPlusPlusAMD64) { std::string argv_i = argv[index]; - std::vector exts = kExtListCxx; + std::vector<std::string> exts = kExtListCxx; BOOL found = false; for (std::string ext : exts) { - if (argv_i.find(ext) != std::string::npos) { + if (argv_i.ends_with(ext)) { found = true; if (kFactory.Compile(argv_i, kMachine) != kExitOK) { @@ -898,7 +898,7 @@ LIBCOMPILER_MODULE(CompilerCPlusPlusAMD64) { if (!found) { if (kVerbose) { - Detail::print_error(argv_i + " is not a valid C++ source.\n", "cxxdrv"); + Detail::print_error(argv_i + " is not a valid C++ source.", "cxxdrv"); } return LIBCOMPILER_INVALID_DATA; @@ -909,12 +909,13 @@ LIBCOMPILER_MODULE(CompilerCPlusPlusAMD64) { delete kCompilerFrontend; kCompilerFrontend = nullptr; - + kRegisterMap.clear(); kOriginMap.clear(); return LIBCOMPILER_SUCCESS; } +// // Last rev 8-1-24 // |
