From 0f11fe006bb16b38e4e8bc442cb14f8a3104f3b0 Mon Sep 17 00:00:00 2001 From: Pasha Bibko <156938226+PashaBibko@users.noreply.github.com> Date: Mon, 5 May 2025 17:17:33 +0100 Subject: [PATCH] Made projects use PCHs --- Common/src/dllmain.cpp | 21 +++++++++++++++++++++ IR-Generator/IR-Generator.vcxproj | 8 ++++++++ IR-Generator/IR-Generator.vcxproj.filters | 3 +++ IR-Generator/inc/Parser.h | 4 ++-- IR-Generator/inc/pch.cpp | 2 ++ Lexer/Lexer.vcxproj | 8 ++++++++ Lexer/Lexer.vcxproj.filters | 3 +++ Lexer/inc/pch.cpp | 2 ++ Lexer/src/Lexer.cpp | 4 ++-- Lexer/src/Token.cpp | 4 ++-- Parser/Parser.vcxproj | 8 ++++++++ Parser/Parser.vcxproj.filters | 3 +++ Parser/inc/AST.h | 4 ++-- Parser/inc/pch.cpp | 2 ++ Parser/src/AST-Constructors.cpp | 2 ++ Parser/src/AST-LLVM.cpp | 4 ++-- Parser/src/AST-Loggers.cpp | 4 ++-- Parser/src/GenIR.cpp | 4 ++-- Parser/src/Parser.cpp | 4 ++-- Parser/src/ParserErrors.cpp | 4 ++-- Parser/src/Scope.cpp | 4 ++-- example/Main.exe | Bin 2560 -> 2560 bytes example/main.lx | 3 ++- example/main.obj | Bin 543 -> 549 bytes 24 files changed, 84 insertions(+), 21 deletions(-) create mode 100644 IR-Generator/inc/pch.cpp create mode 100644 Lexer/inc/pch.cpp create mode 100644 Parser/inc/pch.cpp diff --git a/Common/src/dllmain.cpp b/Common/src/dllmain.cpp index 9d0ab34..91355f7 100644 --- a/Common/src/dllmain.cpp +++ b/Common/src/dllmain.cpp @@ -1,6 +1,27 @@ // dllmain.cpp : Defines the entry point for the DLL application. #include +namespace LX +{ + using DllFunc = bool(HMODULE); + + static bool ProcAttach(HMODULE hModule) + { + } + + static bool ProcDetach(HMODULE hModule) + { + } + + static bool ThreadAttach(HMODULE hModule) + { + } + + static bool ThreadDetach(HMODULE hModule) + { + } +} + BOOL __stdcall DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) diff --git a/IR-Generator/IR-Generator.vcxproj b/IR-Generator/IR-Generator.vcxproj index 7f278ad..0e9e1d9 100644 --- a/IR-Generator/IR-Generator.vcxproj +++ b/IR-Generator/IR-Generator.vcxproj @@ -115,6 +115,8 @@ true $(SolutionDir)common;$(ProjectDir)inc;%(AdditionalIncludeDirectories) stdcpp20 + Use + LX-Common.h Console @@ -133,6 +135,8 @@ true $(SolutionDir)common;$(ProjectDir)inc;%(AdditionalIncludeDirectories) stdcpp20 + Use + LX-Common.h Console @@ -144,6 +148,10 @@ + + Create + Create + diff --git a/IR-Generator/IR-Generator.vcxproj.filters b/IR-Generator/IR-Generator.vcxproj.filters index b8e873d..bd14d3d 100644 --- a/IR-Generator/IR-Generator.vcxproj.filters +++ b/IR-Generator/IR-Generator.vcxproj.filters @@ -14,6 +14,9 @@ Source Files + + Header Files + diff --git a/IR-Generator/inc/Parser.h b/IR-Generator/inc/Parser.h index a20c706..0461c92 100644 --- a/IR-Generator/inc/Parser.h +++ b/IR-Generator/inc/Parser.h @@ -1,10 +1,10 @@ #pragma once +#include + // Lexer foward declares fstream components so we can use them here // #include -#include - // Foward declares the wrapper around the LLVM objects we need to pass around // namespace LX { struct InfoLLVM; } diff --git a/IR-Generator/inc/pch.cpp b/IR-Generator/inc/pch.cpp new file mode 100644 index 0000000..b43841a --- /dev/null +++ b/IR-Generator/inc/pch.cpp @@ -0,0 +1,2 @@ +// Wow, such an intresting file. Don't put anything else in here // +#include diff --git a/Lexer/Lexer.vcxproj b/Lexer/Lexer.vcxproj index 120ebdb..b8dc572 100644 --- a/Lexer/Lexer.vcxproj +++ b/Lexer/Lexer.vcxproj @@ -114,6 +114,8 @@ true $(SolutionDir)common;$(ProjectDir)inc;$(SolutionDir)IR-Generator\inc stdcpp20 + Use + LX-Common.h Console @@ -130,6 +132,8 @@ true $(SolutionDir)common;$(ProjectDir)inc;$(SolutionDir)IR-Generator\inc stdcpp20 + Use + LX-Common.h Console @@ -139,6 +143,10 @@ + + Create + Create + diff --git a/Lexer/Lexer.vcxproj.filters b/Lexer/Lexer.vcxproj.filters index 3ec9ec0..3ebbd43 100644 --- a/Lexer/Lexer.vcxproj.filters +++ b/Lexer/Lexer.vcxproj.filters @@ -17,5 +17,8 @@ Source Files + + Header Files + \ No newline at end of file diff --git a/Lexer/inc/pch.cpp b/Lexer/inc/pch.cpp new file mode 100644 index 0000000..b43841a --- /dev/null +++ b/Lexer/inc/pch.cpp @@ -0,0 +1,2 @@ +// Wow, such an intresting file. Don't put anything else in here // +#include diff --git a/Lexer/src/Lexer.cpp b/Lexer/src/Lexer.cpp index 90af71a..6f2f1b7 100644 --- a/Lexer/src/Lexer.cpp +++ b/Lexer/src/Lexer.cpp @@ -1,7 +1,7 @@ -#include - #include +#include + namespace LX { std::string* InvalidCharInSource::s_Source = nullptr; diff --git a/Lexer/src/Token.cpp b/Lexer/src/Token.cpp index 0c7e727..2101aee 100644 --- a/Lexer/src/Token.cpp +++ b/Lexer/src/Token.cpp @@ -1,7 +1,7 @@ -#include - #include +#include + namespace LX { // Creates the memory for the pointer to the source // diff --git a/Parser/Parser.vcxproj b/Parser/Parser.vcxproj index 9256d96..6fa41f1 100644 --- a/Parser/Parser.vcxproj +++ b/Parser/Parser.vcxproj @@ -114,6 +114,8 @@ true $(SolutionDir)common;$(ProjectDir)inc;$(SolutionDir)IR-Generator\inc stdcpp20 + Use + LX-Common.h Console @@ -130,6 +132,8 @@ true $(SolutionDir)common;$(ProjectDir)inc;$(SolutionDir)IR-Generator\inc stdcpp20 + Use + LX-Common.h Console @@ -139,6 +143,10 @@ + + Create + Create + diff --git a/Parser/Parser.vcxproj.filters b/Parser/Parser.vcxproj.filters index e6aae93..e84a95d 100644 --- a/Parser/Parser.vcxproj.filters +++ b/Parser/Parser.vcxproj.filters @@ -32,6 +32,9 @@ Source Files + + Header Files + diff --git a/Parser/inc/AST.h b/Parser/inc/AST.h index ecdbf3e..ba41561 100644 --- a/Parser/inc/AST.h +++ b/Parser/inc/AST.h @@ -1,7 +1,7 @@ -#include - #include +#include + namespace LX { // Wrapper over the LLVM variables for easier passing around // diff --git a/Parser/inc/pch.cpp b/Parser/inc/pch.cpp new file mode 100644 index 0000000..b43841a --- /dev/null +++ b/Parser/inc/pch.cpp @@ -0,0 +1,2 @@ +// Wow, such an intresting file. Don't put anything else in here // +#include diff --git a/Parser/src/AST-Constructors.cpp b/Parser/src/AST-Constructors.cpp index 8bef2e3..7972a08 100644 --- a/Parser/src/AST-Constructors.cpp +++ b/Parser/src/AST-Constructors.cpp @@ -1,3 +1,5 @@ +#include + #include #include diff --git a/Parser/src/AST-LLVM.cpp b/Parser/src/AST-LLVM.cpp index 6e1b124..62c8d7b 100644 --- a/Parser/src/AST-LLVM.cpp +++ b/Parser/src/AST-LLVM.cpp @@ -1,7 +1,7 @@ -#include - #include +#include + #include namespace LX::AST diff --git a/Parser/src/AST-Loggers.cpp b/Parser/src/AST-Loggers.cpp index 4792b5a..e689084 100644 --- a/Parser/src/AST-Loggers.cpp +++ b/Parser/src/AST-Loggers.cpp @@ -1,7 +1,7 @@ -#include - #include +#include + namespace LX::AST { void MultiNode::Log(std::ofstream* log, unsigned depth) diff --git a/Parser/src/GenIR.cpp b/Parser/src/GenIR.cpp index 6418a8e..a5d1b72 100644 --- a/Parser/src/GenIR.cpp +++ b/Parser/src/GenIR.cpp @@ -1,7 +1,7 @@ -#include - #include +#include + #include namespace LX diff --git a/Parser/src/Parser.cpp b/Parser/src/Parser.cpp index 0bfa69f..e1af18f 100644 --- a/Parser/src/Parser.cpp +++ b/Parser/src/Parser.cpp @@ -1,7 +1,7 @@ -#include - #include +#include + #include namespace LX diff --git a/Parser/src/ParserErrors.cpp b/Parser/src/ParserErrors.cpp index 6a0fb0a..54c37e1 100644 --- a/Parser/src/ParserErrors.cpp +++ b/Parser/src/ParserErrors.cpp @@ -1,7 +1,7 @@ -#include - #include +#include + namespace LX { void IRGenerationError::PrintToConsole() const diff --git a/Parser/src/Scope.cpp b/Parser/src/Scope.cpp index 70dbdeb..bfe65ab 100644 --- a/Parser/src/Scope.cpp +++ b/Parser/src/Scope.cpp @@ -1,7 +1,7 @@ -#include - #include +#include + #include namespace LX diff --git a/example/Main.exe b/example/Main.exe index 6cb4e4ff9739f3a4a5dc1467ba902eed80ea1e9c..c57350fb985ca0c1abb22626255dab26fd542ca3 100644 GIT binary patch delta 61 zcmZn=X%Lyv!1VRe#wIpKM)A#^jFn8nE-EZL|1&TgXHj8eU|`s>AIRR!&+?ja6B`Q? Po45c_Okp!4(>F!{SgsK$ delta 61 zcmZn=X%Lyvz?5`qV-p)Aqu}OF#!4oB78N!I28M1I6_(}$Y>|gIE3({YoNT}%u!)U@ QiA_)dD5tQQk?9*F00{06MF0Q* diff --git a/example/main.lx b/example/main.lx index 6c0a327..d56ce30 100644 --- a/example/main.lx +++ b/example/main.lx @@ -1,6 +1,7 @@ func main() { - int a @ + int a + a = 65465 int b b = 6 diff --git a/example/main.obj b/example/main.obj index 2f5e9e50e078d93bc915741ac92c4f92232bab2a..dd9ec5e96cadd04c93c84a45be7073ecc1012733 100644 GIT binary patch delta 118 zcmbQwvXq50rHz#V1XL$-N;8U2RMlquJTcH8NGw#h_ze_iX9P<#Fas$E1_OtH<1Q*J zJO48<9A{Bs1B&g~4`fFkW@Kb!U}S