From cfa04915a4c7d77996b49279b5891d1402f439a5 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 8 Dec 2025 04:46:00 -0500 Subject: refactor: Refactor `CodeGenerator.h` API. Signed-off-by: Amlal El Mahrouss --- include/CompilerKit/CodeGenerator.h | 48 +++++++++++----------- include/CompilerKit/Detail/Config.h | 2 +- include/CompilerKit/Utilities/Compiler.h | 6 +-- include/DebuggerKit/Detail/Config.h | 2 +- include/LibC++/__abi.h | 4 +- src/CompilerKit/src/Assemblers/Assembler+32x0.cc | 2 +- src/CompilerKit/src/Assemblers/Assembler+64x0.cc | 40 ++++++++++-------- src/CompilerKit/src/Assemblers/Assembler+AMD64.cc | 33 +++++++++------ src/CompilerKit/src/Assemblers/Assembler+ARM64.cc | 8 ++-- .../src/Assemblers/Assembler+PowerPC.cc | 19 +++++---- src/CompilerKit/src/Compilers/CCompiler+64x0.cc | 2 +- src/CompilerKit/src/Compilers/CCompiler+ARM64.cc | 3 +- src/CompilerKit/src/Compilers/CCompiler+Power64.cc | 2 +- .../src/Compilers/CPlusPlusCompiler+AMD64.cc | 4 +- src/Tools/pef-amd64-cxxdrv.cc | 3 +- tests/test_02_linker/linker_test.cc | 4 +- 16 files changed, 99 insertions(+), 83 deletions(-) diff --git a/include/CompilerKit/CodeGenerator.h b/include/CompilerKit/CodeGenerator.h index 79b185b..259c52d 100644 --- a/include/CompilerKit/CodeGenerator.h +++ b/include/CompilerKit/CodeGenerator.h @@ -40,9 +40,9 @@ class AssemblyFactory final { kArchCount = kArchUnknown - kArchAMD64, }; - Int32 Compile(std::string sourceFile, const Int32& arch) noexcept; + Int32 Compile(STLString sourceFile, const Int32& arch) noexcept; - void Mount(IAssembly* mountPtr) noexcept; + void Mount(IAssembly* mountPtr) noexcept; IAssembly* Unmount() noexcept; private: @@ -66,7 +66,7 @@ class IAssembly { /// @brief compile to object file. /// @note Example C++ -> MASM -> AE object. /// =========================================================== /// - virtual Int32 CompileToFormat(std::string src, Int32 arch) = 0; + virtual Int32 CompileToFormat(STLString src, Int32 arch) = 0; }; /// =========================================================== /// @@ -133,9 +133,9 @@ class EncoderInterface { NECTI_COPY_DEFAULT(EncoderInterface); - virtual std::string CheckLine(std::string line, std::string file) = 0; - virtual bool WriteLine(std::string line, std::string file) = 0; - virtual bool WriteNumber(const std::size_t& pos, std::string& from_what) = 0; + virtual STLString CheckLine(STLString line, STLString file) = 0; + virtual bool WriteLine(STLString line, STLString file) = 0; + virtual bool WriteNumber(const std::size_t& pos, STLString& from_what) = 0; }; /// =========================================================== /// @@ -151,13 +151,13 @@ class EncoderAMD64 final : public EncoderInterface { NECTI_COPY_DEFAULT(EncoderAMD64); - virtual std::string CheckLine(std::string line, std::string file) override; - virtual bool WriteLine(std::string line, std::string file) override; - virtual bool WriteNumber(const std::size_t& pos, std::string& from_what) override; + virtual STLString CheckLine(STLString line, STLString file) override; + virtual bool WriteLine(STLString line, STLString file) override; + virtual bool WriteNumber(const std::size_t& pos, STLString& from_what) override; - virtual bool WriteNumber16(const std::size_t& pos, std::string& from_what); - virtual bool WriteNumber32(const std::size_t& pos, std::string& from_what); - virtual bool WriteNumber8(const std::size_t& pos, std::string& from_what); + virtual bool WriteNumber16(const std::size_t& pos, STLString& from_what); + virtual bool WriteNumber32(const std::size_t& pos, STLString& from_what); + virtual bool WriteNumber8(const std::size_t& pos, STLString& from_what); }; #endif // __ASM_NEED_AMD64__ @@ -171,9 +171,9 @@ class EncoderARM64 final : public EncoderInterface { NECTI_COPY_DEFAULT(EncoderARM64); - virtual std::string CheckLine(std::string line, std::string file) override; - virtual bool WriteLine(std::string line, std::string file) override; - virtual bool WriteNumber(const std::size_t& pos, std::string& from_what) override; + virtual STLString CheckLine(STLString line, STLString file) override; + virtual bool WriteLine(STLString line, STLString file) override; + virtual bool WriteNumber(const std::size_t& pos, STLString& from_what) override; }; #endif // __ASM_NEED_ARM64__ @@ -187,9 +187,9 @@ class Encoder64x0 final : public EncoderInterface { NECTI_COPY_DEFAULT(Encoder64x0); - virtual std::string CheckLine(std::string line, std::string file) override; - virtual bool WriteLine(std::string line, std::string file) override; - virtual bool WriteNumber(const std::size_t& pos, std::string& from_what) override; + virtual STLString CheckLine(STLString line, STLString file) override; + virtual bool WriteLine(STLString line, STLString file) override; + virtual bool WriteNumber(const std::size_t& pos, STLString& from_what) override; }; #endif // __ASM_NEED_64x0__ @@ -203,9 +203,9 @@ class Encoder32x0 final : public EncoderInterface { NECTI_COPY_DEFAULT(Encoder32x0); - virtual std::string CheckLine(std::string line, std::string file) override; - virtual bool WriteLine(std::string line, std::string file) override; - virtual bool WriteNumber(const std::size_t& pos, std::string& from_what) override; + virtual STLString CheckLine(STLString line, STLString file) override; + virtual bool WriteLine(STLString line, STLString file) override; + virtual bool WriteNumber(const std::size_t& pos, STLString& from_what) override; }; #endif // __ASM_NEED_32x0__ @@ -219,9 +219,9 @@ class EncoderPowerPC final : public EncoderInterface { NECTI_COPY_DEFAULT(EncoderPowerPC); - virtual std::string CheckLine(std::string line, std::string file) override; - virtual bool WriteLine(std::string line, std::string file) override; - virtual bool WriteNumber(const std::size_t& pos, std::string& from_what) override; + virtual STLString CheckLine(STLString line, STLString file) override; + virtual bool WriteLine(STLString line, STLString file) override; + virtual bool WriteNumber(const std::size_t& pos, STLString& from_what) override; }; #endif // __ASM_NEED_32x0__ diff --git a/include/CompilerKit/Detail/Config.h b/include/CompilerKit/Detail/Config.h index 6137e2a..74d0724 100644 --- a/include/CompilerKit/Detail/Config.h +++ b/include/CompilerKit/Detail/Config.h @@ -16,7 +16,7 @@ namespace CompilerKit { inline constexpr int kBaseYear = 1900; -using STLString = std::string; +using STLString = std::string; inline STLString current_date() noexcept { auto time_data = time(nullptr); diff --git a/include/CompilerKit/Utilities/Compiler.h b/include/CompilerKit/Utilities/Compiler.h index 41b7771..0fa95df 100644 --- a/include/CompilerKit/Utilities/Compiler.h +++ b/include/CompilerKit/Utilities/Compiler.h @@ -43,9 +43,7 @@ struct Blob final { std::vector mBlob{}; // PEF code/bss/data blob. UIntPtr mOffset{0UL}; // the offset of the PEF container header... - explicit operator bool() { - return mBlob.empty() && mOffset > 0UL; - } + explicit operator bool() { return mBlob.empty() && mOffset > 0UL; } }; inline void print_error(STLString reason, STLString file) noexcept { @@ -120,4 +118,4 @@ inline void drvi_crash_handler(std::int32_t id) { std::exit(NECTI_EXEC_ERROR); } -} // namespace Detail +} // namespace CompilerKit::Detail diff --git a/include/DebuggerKit/Detail/Config.h b/include/DebuggerKit/Detail/Config.h index 0ea3ba1..f5593fd 100644 --- a/include/DebuggerKit/Detail/Config.h +++ b/include/DebuggerKit/Detail/Config.h @@ -61,6 +61,6 @@ namespace Detail { constexpr uint16_t kDebugVersion = 0x0100; constexpr auto kDebugDelim = ';'; constexpr auto kDebugEnd = '\r'; - using dk_socket_type = int64_t; + using dk_socket_type = int64_t; } // namespace Detail } // namespace DebuggerKit \ No newline at end of file diff --git a/include/LibC++/__abi.h b/include/LibC++/__abi.h index 6b4b058..c8ac2a5 100644 --- a/include/LibC++/__abi.h +++ b/include/LibC++/__abi.h @@ -6,12 +6,12 @@ #pragma once -#include #include +#include __init_decl() -static constexpr int32_t __unreachable_code = 34; + static constexpr int32_t __unreachable_code = 34; inline void __compilerkit_unreachable(void) { std::base_process::signal(__unreachable_code); diff --git a/src/CompilerKit/src/Assemblers/Assembler+32x0.cc b/src/CompilerKit/src/Assemblers/Assembler+32x0.cc index 9229cf1..1b8d9f6 100644 --- a/src/CompilerKit/src/Assemblers/Assembler+32x0.cc +++ b/src/CompilerKit/src/Assemblers/Assembler+32x0.cc @@ -23,8 +23,8 @@ #include #include -#include #include +#include #include ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/CompilerKit/src/Assemblers/Assembler+64x0.cc b/src/CompilerKit/src/Assemblers/Assembler+64x0.cc index 35a6bb2..757f5b4 100644 --- a/src/CompilerKit/src/Assemblers/Assembler+64x0.cc +++ b/src/CompilerKit/src/Assemblers/Assembler+64x0.cc @@ -23,8 +23,8 @@ #include #include -#include #include +#include #include #include #include @@ -269,7 +269,8 @@ static bool asm_read_attributes(std::string line) { // that we need this symbol. if (CompilerKit::ast_find_needle(line, "extern_segment")) { if (kOutputAsBinary) { - CompilerKit::Detail::print_error("Invalid extern_segment directive in flat binary mode.", "CompilerKit"); + CompilerKit::Detail::print_error("Invalid extern_segment directive in flat binary mode.", + "CompilerKit"); throw std::runtime_error("invalid_extern_segment_bin"); } @@ -329,7 +330,8 @@ static bool asm_read_attributes(std::string line) { // .zero64 else if (CompilerKit::ast_find_needle(line, "public_segment")) { if (kOutputAsBinary) { - CompilerKit::Detail::print_error("Invalid public_segment directive in flat binary mode.", "CompilerKit"); + CompilerKit::Detail::print_error("Invalid public_segment directive in flat binary mode.", + "CompilerKit"); throw std::runtime_error("invalid_public_segment_bin"); } @@ -616,7 +618,8 @@ bool CompilerKit::Encoder64x0::WriteLine(std::string line, std::string file) { for (auto& opcode64x0 : kOpcodes64x0) { // strict check here - if (CompilerKit::ast_find_needle(line, opcode64x0.fName) && CompilerKit::Detail::algorithm::is_valid_64x0(line)) { + if (CompilerKit::ast_find_needle(line, opcode64x0.fName) && + CompilerKit::Detail::algorithm::is_valid_64x0(line)) { std::string name(opcode64x0.fName); std::string jump_label, cpy_jump_label; @@ -649,9 +652,10 @@ bool CompilerKit::Encoder64x0::WriteLine(std::string line, std::string file) { if (kOutputArch == CompilerKit::kPefArch64000) { if (isdigit(line[line_index + 3]) && isdigit(line[line_index + 2])) { reg_str += line[line_index + 3]; - CompilerKit::Detail::print_error("invalid register index, r" + reg_str + - "\nnote: The 64x0 accepts registers from r0 to r20.", - file); + CompilerKit::Detail::print_error( + "invalid register index, r" + reg_str + + "\nnote: The 64x0 accepts registers from r0 to r20.", + file); throw std::runtime_error("invalid_register_index"); } } @@ -688,16 +692,16 @@ bool CompilerKit::Encoder64x0::WriteLine(std::string line, std::string file) { } if (found_some < 1 && name != "ldw" && name != "lda" && name != "stw") { - CompilerKit::Detail::print_error("invalid combination of opcode and registers.\nline: " + line, - file); + CompilerKit::Detail::print_error( + "invalid combination of opcode and registers.\nline: " + line, file); throw std::runtime_error("invalid_comb_op_reg"); } else if (found_some == 1 && name == "add") { - CompilerKit::Detail::print_error("invalid combination of opcode and registers.\nline: " + line, - file); + CompilerKit::Detail::print_error( + "invalid combination of opcode and registers.\nline: " + line, file); throw std::runtime_error("invalid_comb_op_reg"); } else if (found_some == 1 && name == "sub") { - CompilerKit::Detail::print_error("invalid combination of opcode and registers.\nline: " + line, - file); + CompilerKit::Detail::print_error( + "invalid combination of opcode and registers.\nline: " + line, file); throw std::runtime_error("invalid_comb_op_reg"); } @@ -759,13 +763,14 @@ bool CompilerKit::Encoder64x0::WriteLine(std::string line, std::string file) { if (!this->WriteNumber(0, jump_label)) { // sta expects this: sta 0x000000, r0 if (name == "sta") { - CompilerKit::Detail::print_error("invalid combination of opcode and operands.\nHere ->" + line, - file); + CompilerKit::Detail::print_error( + "invalid combination of opcode and operands.\nHere ->" + line, file); throw std::runtime_error("invalid_comb_op_ops"); } } else { if (name == "sta" && cpy_jump_label.find("extern_segment ") != std::string::npos) { - CompilerKit::Detail::print_error("invalid usage extern_segment on 'sta', here: " + line, file); + CompilerKit::Detail::print_error("invalid usage extern_segment on 'sta', here: " + line, + file); throw std::runtime_error("invalid_sta_usage"); } } @@ -783,7 +788,8 @@ bool CompilerKit::Encoder64x0::WriteLine(std::string line, std::string file) { cpy_jump_label.erase(cpy_jump_label.find("extern_segment"), strlen("extern_segment")); if (name == "sta") { - CompilerKit::Detail::print_error("extern_segment is not allowed on a sta operation.", file); + CompilerKit::Detail::print_error("extern_segment is not allowed on a sta operation.", + file); throw std::runtime_error("extern_segment_sta_op"); } else { goto asm_end_label_cpy; diff --git a/src/CompilerKit/src/Assemblers/Assembler+AMD64.cc b/src/CompilerKit/src/Assemblers/Assembler+AMD64.cc index e69d4b6..7146a53 100644 --- a/src/CompilerKit/src/Assemblers/Assembler+AMD64.cc +++ b/src/CompilerKit/src/Assemblers/Assembler+AMD64.cc @@ -30,8 +30,8 @@ #include #include -#include #include +#include #include #include #include @@ -496,8 +496,8 @@ std::string CompilerKit::EncoderAMD64::CheckLine(std::string line, std::string f if (line.empty() || CompilerKit::ast_find_needle(line, "extern_segment") || CompilerKit::ast_find_needle(line, "public_segment") || - CompilerKit::ast_find_needle(line, kAssemblerPragmaSymStr) || CompilerKit::ast_find_needle(line, ";") || - line[0] == kAssemblerPragmaSym) { + CompilerKit::ast_find_needle(line, kAssemblerPragmaSymStr) || + CompilerKit::ast_find_needle(line, ";") || line[0] == kAssemblerPragmaSym) { if (line.find(';') != std::string::npos) { line.erase(line.find(';')); } else { @@ -1006,9 +1006,10 @@ bool CompilerKit::EncoderAMD64::WriteLine(std::string line, std::string file) { if (bits == 16) { if (registerName[0] == 'r') { - CompilerKit::Detail::print_error("invalid size for register, current bit width is: " + - std::to_string(kRegisterBitWidth), - file); + CompilerKit::Detail::print_error( + "invalid size for register, current bit width is: " + + std::to_string(kRegisterBitWidth), + file); throw std::runtime_error("invalid_reg_size"); } } @@ -1047,7 +1048,7 @@ bool CompilerKit::EncoderAMD64::WriteLine(std::string line, std::string file) { } else if (bits == 16) { if (hasRBasedRegs) { CompilerKit::Detail::print_error("Invalid combination of operands and registers.", - "CompilerKit"); + "CompilerKit"); throw std::runtime_error("comb_op_reg"); } else { kAppBytes.emplace_back(0x66); @@ -1085,33 +1086,39 @@ bool CompilerKit::EncoderAMD64::WriteLine(std::string line, std::string file) { } if (currentRegList[1].fName[0] == 'r' && currentRegList[0].fName[0] == 'e') { - CompilerKit::Detail::print_error("Invalid combination of operands and registers.", "CompilerKit"); + CompilerKit::Detail::print_error("Invalid combination of operands and registers.", + "CompilerKit"); throw std::runtime_error("comb_op_reg"); } if (currentRegList[0].fName[0] == 'r' && currentRegList[1].fName[0] == 'e') { - CompilerKit::Detail::print_error("Invalid combination of operands and registers.", "CompilerKit"); + CompilerKit::Detail::print_error("Invalid combination of operands and registers.", + "CompilerKit"); throw std::runtime_error("comb_op_reg"); } if (bits == 16) { if (currentRegList[0].fName[0] == 'r' || currentRegList[0].fName[0] == 'e') { - CompilerKit::Detail::print_error("Invalid combination of operands and registers.", "CompilerKit"); + CompilerKit::Detail::print_error("Invalid combination of operands and registers.", + "CompilerKit"); throw std::runtime_error("comb_op_reg"); } if (currentRegList[1].fName[0] == 'r' || currentRegList[1].fName[0] == 'e') { - CompilerKit::Detail::print_error("Invalid combination of operands and registers.", "CompilerKit"); + CompilerKit::Detail::print_error("Invalid combination of operands and registers.", + "CompilerKit"); throw std::runtime_error("comb_op_reg"); } } else { if (currentRegList[0].fName[0] != 'r' || currentRegList[0].fName[0] == 'e') { - CompilerKit::Detail::print_error("Invalid combination of operands and registers.", "CompilerKit"); + CompilerKit::Detail::print_error("Invalid combination of operands and registers.", + "CompilerKit"); throw std::runtime_error("comb_op_reg"); } if (currentRegList[1].fName[0] != 'r' || currentRegList[1].fName[0] == 'e') { - CompilerKit::Detail::print_error("Invalid combination of operands and registers.", "CompilerKit"); + CompilerKit::Detail::print_error("Invalid combination of operands and registers.", + "CompilerKit"); throw std::runtime_error("comb_op_reg"); } } diff --git a/src/CompilerKit/src/Assemblers/Assembler+ARM64.cc b/src/CompilerKit/src/Assemblers/Assembler+ARM64.cc index c4e4fb6..5113704 100644 --- a/src/CompilerKit/src/Assemblers/Assembler+ARM64.cc +++ b/src/CompilerKit/src/Assemblers/Assembler+ARM64.cc @@ -21,10 +21,10 @@ #include #include +#include #include #include #include -#include #include #include #include @@ -274,7 +274,8 @@ static bool asm_read_attributes(std::string line) { // that we need this symbol. if (CompilerKit::ast_find_needle(line, "extern_segment")) { if (kOutputAsBinary) { - CompilerKit::Detail::print_error("Invalid extern_segment directive in flat binary mode.", "CompilerKit"); + CompilerKit::Detail::print_error("Invalid extern_segment directive in flat binary mode.", + "CompilerKit"); throw std::runtime_error("invalid_extern_segment_bin"); } @@ -333,7 +334,8 @@ static bool asm_read_attributes(std::string line) { // .zero64 else if (CompilerKit::ast_find_needle(line, "public_segment")) { if (kOutputAsBinary) { - CompilerKit::Detail::print_error("Invalid public_segment directive in flat binary mode.", "CompilerKit"); + CompilerKit::Detail::print_error("Invalid public_segment directive in flat binary mode.", + "CompilerKit"); throw std::runtime_error("invalid_public_segment_bin"); } diff --git a/src/CompilerKit/src/Assemblers/Assembler+PowerPC.cc b/src/CompilerKit/src/Assemblers/Assembler+PowerPC.cc index 6c698bd..bad9535 100644 --- a/src/CompilerKit/src/Assemblers/Assembler+PowerPC.cc +++ b/src/CompilerKit/src/Assemblers/Assembler+PowerPC.cc @@ -22,9 +22,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -274,7 +274,8 @@ static bool asm_read_attributes(std::string line) { // that we need this symbol. if (CompilerKit::ast_find_needle(line, "extern_segment")) { if (kOutputAsBinary) { - CompilerKit::Detail::print_error("Invalid extern_segment directive in flat binary mode.", "CompilerKit"); + CompilerKit::Detail::print_error("Invalid extern_segment directive in flat binary mode.", + "CompilerKit"); throw std::runtime_error("invalid_extern_segment_bin"); } @@ -333,7 +334,8 @@ static bool asm_read_attributes(std::string line) { // .zero64 else if (CompilerKit::ast_find_needle(line, "public_segment")) { if (kOutputAsBinary) { - CompilerKit::Detail::print_error("Invalid public_segment directive in flat binary mode.", "CompilerKit"); + CompilerKit::Detail::print_error("Invalid public_segment directive in flat binary mode.", + "CompilerKit"); throw std::runtime_error("invalid_public_segment_bin"); } @@ -676,9 +678,10 @@ bool CompilerKit::EncoderPowerPC::WriteLine(std::string line, std::string file) // something like r190 doesn't exist in the instruction set. if (isdigit(line[line_index + 3]) && isdigit(line[line_index + 2])) { reg_str += line[line_index + 3]; - CompilerKit::Detail::print_error("invalid register index, r" + reg_str + - "\nnote: The POWER accepts registers from r0 to r32.", - file); + CompilerKit::Detail::print_error( + "invalid register index, r" + reg_str + + "\nnote: The POWER accepts registers from r0 to r32.", + file); throw std::runtime_error("invalid_register_index"); } @@ -892,8 +895,8 @@ bool CompilerKit::EncoderPowerPC::WriteLine(std::string line, std::string file) } if (found_some_count < 1 && name[0] != 'l' && name[0] != 's') { - CompilerKit::Detail::print_error("invalid combination of opcode and registers.\nline: " + line, - file); + CompilerKit::Detail::print_error( + "invalid combination of opcode and registers.\nline: " + line, file); throw std::runtime_error("invalid_comb_op_reg"); } diff --git a/src/CompilerKit/src/Compilers/CCompiler+64x0.cc b/src/CompilerKit/src/Compilers/CCompiler+64x0.cc index 06768eb..394f933 100644 --- a/src/CompilerKit/src/Compilers/CCompiler+64x0.cc +++ b/src/CompilerKit/src/Compilers/CCompiler+64x0.cc @@ -11,8 +11,8 @@ /// TODO: none #include -#include #include +#include #include #include #include diff --git a/src/CompilerKit/src/Compilers/CCompiler+ARM64.cc b/src/CompilerKit/src/Compilers/CCompiler+ARM64.cc index ad4227b..7b99b70 100644 --- a/src/CompilerKit/src/Compilers/CCompiler+ARM64.cc +++ b/src/CompilerKit/src/Compilers/CCompiler+ARM64.cc @@ -11,8 +11,8 @@ /// TODO: none #include -#include #include +#include #include #include @@ -42,7 +42,6 @@ ///////////////////// - ///////////////////////////////////// // INTERNAL STUFF OF THE C COMPILER diff --git a/src/CompilerKit/src/Compilers/CCompiler+Power64.cc b/src/CompilerKit/src/Compilers/CCompiler+Power64.cc index e123c3d..993ee7c 100644 --- a/src/CompilerKit/src/Compilers/CCompiler+Power64.cc +++ b/src/CompilerKit/src/Compilers/CCompiler+Power64.cc @@ -8,8 +8,8 @@ */ #include -#include #include +#include #include #include #include diff --git a/src/CompilerKit/src/Compilers/CPlusPlusCompiler+AMD64.cc b/src/CompilerKit/src/Compilers/CPlusPlusCompiler+AMD64.cc index c54cc53..4f85f05 100644 --- a/src/CompilerKit/src/Compilers/CPlusPlusCompiler+AMD64.cc +++ b/src/CompilerKit/src/Compilers/CPlusPlusCompiler+AMD64.cc @@ -22,9 +22,9 @@ /////////////////////// #include +#include #include #include -#include #include #include #include @@ -165,7 +165,7 @@ CompilerKit::SyntaxLeafList::SyntaxLeaf CompilerFrontendCPlusPlusAMD64::Compile( if (text.empty()) return syntax_tree; - std::size_t index = 0UL; + std::size_t index = 0UL; std::vector> keywords_list; for (auto& keyword : kKeywords) { diff --git a/src/Tools/pef-amd64-cxxdrv.cc b/src/Tools/pef-amd64-cxxdrv.cc index fa03d25..9e8c0da 100644 --- a/src/Tools/pef-amd64-cxxdrv.cc +++ b/src/Tools/pef-amd64-cxxdrv.cc @@ -24,7 +24,8 @@ Int32 main(Int32 argc, Char const* argv[]) { CompilerKit::DLLTraits dylib; dylib(kPath, kSymbol); - CompilerKit::DLLTraits::Entrypoint entrypoint_cxx = reinterpret_cast(dylib.fEntrypoint); + CompilerKit::DLLTraits::Entrypoint entrypoint_cxx = + reinterpret_cast(dylib.fEntrypoint); if (!entrypoint_cxx) { kStdOut; diff --git a/tests/test_02_linker/linker_test.cc b/tests/test_02_linker/linker_test.cc index d126060..3c18fe0 100644 --- a/tests/test_02_linker/linker_test.cc +++ b/tests/test_02_linker/linker_test.cc @@ -23,7 +23,7 @@ TEST(LinkerTest, BasicLinkTest2) { /// link TEST(LinkerTest, BasicLinkTest3) { - auto expr = - std::system("ld64 -amd64 test_samples/sample.cc.pp.obj -start __NECTI_main -output main.exec"); + auto expr = std::system( + "ld64 -amd64 test_samples/sample.cc.pp.obj -start __NECTI_main -output main.exec"); EXPECT_TRUE(expr == 0) << "Linker did not link the easy object."; } -- cgit v1.2.3