diff options
Diffstat (limited to 'dev/LibCompiler/src/Cl')
| -rw-r--r-- | dev/LibCompiler/src/Cl/CCompiler64x0.cc | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/src/Cl/CCompilerARM64.cc | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/src/Cl/CCompilerPower64.cc | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/src/Cl/CPlusPlusCompilerAMD64.cc | 26 |
4 files changed, 10 insertions, 22 deletions
diff --git a/dev/LibCompiler/src/Cl/CCompiler64x0.cc b/dev/LibCompiler/src/Cl/CCompiler64x0.cc index 2d37227..fc31ef9 100644 --- a/dev/LibCompiler/src/Cl/CCompiler64x0.cc +++ b/dev/LibCompiler/src/Cl/CCompiler64x0.cc @@ -1198,7 +1198,7 @@ static void cc_print_help() { #define kExt ".c" LIBCOMPILER_MODULE(NeOSCompilerCLang64x0) { - ::signal(SIGSEGV, Detail::drv_segfault_handler); + ::signal(SIGSEGV, Detail::drvi_crash_handler); kCompilerTypes.push_back({.fName = "void", .fValue = "void"}); kCompilerTypes.push_back({.fName = "char", .fValue = "byte"}); diff --git a/dev/LibCompiler/src/Cl/CCompilerARM64.cc b/dev/LibCompiler/src/Cl/CCompilerARM64.cc index 093c818..02e39f9 100644 --- a/dev/LibCompiler/src/Cl/CCompilerARM64.cc +++ b/dev/LibCompiler/src/Cl/CCompilerARM64.cc @@ -1196,7 +1196,7 @@ static void cc_print_help() { #define kCExtension ".c" LIBCOMPILER_MODULE(NeOSCompilerCLangARM64) { - ::signal(SIGSEGV, Detail::drv_segfault_handler); + ::signal(SIGSEGV, Detail::drvi_crash_handler); kCompilerTypes.push_back({.fName = "void", .fValue = "void"}); kCompilerTypes.push_back({.fName = "char", .fValue = "byte"}); diff --git a/dev/LibCompiler/src/Cl/CCompilerPower64.cc b/dev/LibCompiler/src/Cl/CCompilerPower64.cc index e0081f7..216891a 100644 --- a/dev/LibCompiler/src/Cl/CCompilerPower64.cc +++ b/dev/LibCompiler/src/Cl/CCompilerPower64.cc @@ -1215,7 +1215,7 @@ static void cc_print_help() { #define kExt ".c" LIBCOMPILER_MODULE(NeOSCompilerCLangPowerPC) { - ::signal(SIGSEGV, Detail::drv_segfault_handler); + ::signal(SIGSEGV, Detail::drvi_crash_handler); kCompilerTypes.push_back({.fName = "void", .fValue = "void"}); kCompilerTypes.push_back({.fName = "char", .fValue = "byte"}); diff --git a/dev/LibCompiler/src/Cl/CPlusPlusCompilerAMD64.cc b/dev/LibCompiler/src/Cl/CPlusPlusCompilerAMD64.cc index 856bc64..bfa1896 100644 --- a/dev/LibCompiler/src/Cl/CPlusPlusCompilerAMD64.cc +++ b/dev/LibCompiler/src/Cl/CPlusPlusCompilerAMD64.cc @@ -9,6 +9,7 @@ /// BUGS: 1 +#include "LibCompiler/Defines.h" #define kPrintF printf #define kExitOK (EXIT_SUCCESS) @@ -71,18 +72,14 @@ struct CompilerRegisterMap final { std::string fReg; }; -// \brief Offset based struct/class +/// \brief Offset based struct/class struct CompilerStructMap final { - std::string fName; - std::string fReg; - - // offset counter - std::size_t fOffsetsCnt; - - // offset array + std::string fName; + std::string fReg; std::vector<std::pair<UInt32, std::string>> fOffsets; }; +/// \brief Compiler state structure. struct CompilerState final { std::vector<CompilerRegisterMap> fStackMapVector; std::vector<CompilerStructMap> fStructMapVector; @@ -99,7 +96,7 @@ static Int32 kOnClassScope = 0; ///////////////////////////////////////////////////////////////////////////////////////// // Target architecture. -static int kMachine = LibCompiler::AssemblyFactory::kArchAMD64; +static Int32 kMachine = LibCompiler::AssemblyFactory::kArchAMD64; ///////////////////////////////////////// @@ -740,21 +737,12 @@ class AssemblyCPlusPlusInterface final LC_ASSEMBLY_INTERFACE { std::string line_source; while (std::getline(src_fp, line_source)) { - if (kVerbose) { - kStdOut << line_source << std::endl; - kStdOut << line_source.length() << " bytes\n"; - } - kCompilerFrontend->Compile(line_source, src); out_fp << kState.fOutputValue; kState.fOutputValue.clear(); } - if (kVerbose) { - kStdOut << "Done compiling " << src << " to " << dest << "\n"; - } - return kExitOK; } }; @@ -832,7 +820,7 @@ LIBCOMPILER_MODULE(CompilerCPlusPlusAMD64) { kCompilerFrontend = new CompilerFrontendCPlusPlus(); kFactory.Mount(new AssemblyCPlusPlusInterface()); - ::signal(SIGSEGV, Detail::drv_segfault_handler); + ::signal(SIGSEGV, Detail::drvi_crash_handler); for (auto index = 1UL; index < argc; ++index) { if (argv[index][0] == '-') { |
