From fff64c18560a6ad01bdc152d39ee25e54d87e924 Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Mon, 24 Feb 2025 12:22:39 +0100 Subject: [PATCH 1/3] fix: mark the Optimizer, MacroProcessor, NameResolutionPass and ImportSolver as exported --- include/Ark/Compiler/AST/Optimizer.hpp | 3 ++- include/Ark/Compiler/Macros/Processor.hpp | 3 ++- include/Ark/Compiler/NameResolution/NameResolutionPass.hpp | 3 ++- include/Ark/Compiler/Package/ImportSolver.hpp | 3 ++- include/Ark/Compiler/Pass.hpp | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/include/Ark/Compiler/AST/Optimizer.hpp b/include/Ark/Compiler/AST/Optimizer.hpp index 16e4bccc8..f702646d1 100644 --- a/include/Ark/Compiler/AST/Optimizer.hpp +++ b/include/Ark/Compiler/AST/Optimizer.hpp @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -25,7 +26,7 @@ namespace Ark::internal * @brief The ArkScript AST optimizer * */ - class Optimizer final : public Pass + class ARK_API Optimizer final : public Pass { public: /** diff --git a/include/Ark/Compiler/Macros/Processor.hpp b/include/Ark/Compiler/Macros/Processor.hpp index 1c1daf0af..8759bd121 100644 --- a/include/Ark/Compiler/Macros/Processor.hpp +++ b/include/Ark/Compiler/Macros/Processor.hpp @@ -12,6 +12,7 @@ #ifndef COMPILER_MACROS_PROCESSOR_HPP #define COMPILER_MACROS_PROCESSOR_HPP +#include #include #include #include @@ -28,7 +29,7 @@ namespace Ark::internal * @brief The class handling the macros definitions and calls, given an AST * */ - class MacroProcessor final : public Pass + class ARK_API MacroProcessor final : public Pass { public: /** diff --git a/include/Ark/Compiler/NameResolution/NameResolutionPass.hpp b/include/Ark/Compiler/NameResolution/NameResolutionPass.hpp index fbf4686cc..ba1b0b70b 100644 --- a/include/Ark/Compiler/NameResolution/NameResolutionPass.hpp +++ b/include/Ark/Compiler/NameResolution/NameResolutionPass.hpp @@ -16,12 +16,13 @@ #include #include +#include #include #include namespace Ark::internal { - class NameResolutionPass final : public Pass + class ARK_API NameResolutionPass final : public Pass { public: /** diff --git a/include/Ark/Compiler/Package/ImportSolver.hpp b/include/Ark/Compiler/Package/ImportSolver.hpp index 5f301cdc3..cc5c5b880 100644 --- a/include/Ark/Compiler/Package/ImportSolver.hpp +++ b/include/Ark/Compiler/Package/ImportSolver.hpp @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -25,7 +26,7 @@ namespace Ark::internal { - class ImportSolver final : public Pass + class ARK_API ImportSolver final : public Pass { public: /** diff --git a/include/Ark/Compiler/Pass.hpp b/include/Ark/Compiler/Pass.hpp index 6e364c672..8da3ca289 100644 --- a/include/Ark/Compiler/Pass.hpp +++ b/include/Ark/Compiler/Pass.hpp @@ -11,6 +11,7 @@ #ifndef ARK_COMPILER_PASS_HPP #define ARK_COMPILER_PASS_HPP +#include #include #include @@ -19,7 +20,7 @@ namespace Ark::internal /** * @brief An interface to describe compiler passes */ - class Pass + class ARK_API Pass { public: /** From 0af60ecd18578543a87d72c0a29fa5355759290b Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Mon, 24 Feb 2025 12:41:30 +0100 Subject: [PATCH 2/3] fix(msvc): mark the StaticScope and the NamespaceScope as non-copyable and non-movable, otherwise msvc and its stdlib crap themselves trying to make a vector of unique_ptr copyable --- include/Ark/Compiler/NameResolution/StaticScope.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/Ark/Compiler/NameResolution/StaticScope.hpp b/include/Ark/Compiler/NameResolution/StaticScope.hpp index 35f37c442..8874a8e94 100644 --- a/include/Ark/Compiler/NameResolution/StaticScope.hpp +++ b/include/Ark/Compiler/NameResolution/StaticScope.hpp @@ -49,6 +49,13 @@ namespace Ark::internal public: virtual ~StaticScope() = default; + StaticScope() = default; + + StaticScope(const StaticScope&) = delete; + StaticScope& operator=(const StaticScope&) = delete; + StaticScope(StaticScope&&) = default; + StaticScope& operator=(StaticScope&&) = default; + /** * @brief Add a Declaration to the scope, given a mutability status * @param name @@ -95,6 +102,11 @@ namespace Ark::internal public: NamespaceScope(std::string name, bool with_prefix, bool is_glob, const std::vector& symbols); + NamespaceScope(const NamespaceScope&) = delete; + NamespaceScope& operator=(const NamespaceScope&) = delete; + NamespaceScope(NamespaceScope&&) = default; + NamespaceScope& operator=(NamespaceScope&&) = default; + /** * @brief Add a Declaration to the scope, given a mutability status * @param name From 192c939c4aef107c7b49e4b5f436783b8825b241 Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Mon, 24 Feb 2025 13:16:27 +0100 Subject: [PATCH 3/3] fix(cmake): set fmtlib visibility to default, upgrade fmtlib to 11.1.3 --- CHANGELOG.md | 1 + CMakeLists.txt | 5 ++++- lib/fmt | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec18773b5..b5cc2036a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -101,6 +101,7 @@ - `list:setAt` can work with negative indexes, and is now bound checked - re-enabled the AST optimizer, only used for the main `arkscript` executable (not enabled when embedding arkscript, so that one can grab variables from the VM) - loops have their own scope: variables created inside a loop won't leak outside it +- upgraded fmtlib to 11.1.3-13 ### Removed - removed unused `NodeType::Closure` diff --git a/CMakeLists.txt b/CMakeLists.txt index cfed6a6c8..ab7d39545 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,8 @@ if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG OR APPLE) -fvisibility=hidden -fno-semantic-interposition ) + # set fmtlib visibility to default + target_compile_definitions(ArkReactor PUBLIC FMT_SHARED) if (APPLE) # The standard SSH libraries are depreciate on APPLE. @@ -114,7 +116,8 @@ elseif (MSVC) /wd4267 # disable warning about data loss (size_t -> int) /wd4244 # disable warning about data loss (size_t -> char) /wd4505 # disable warning about unused static function was deleted - /wd4068) # disable warnings about unknown pragmas. + /wd4068 # disable warnings about unknown pragmas. + /utf-8) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:8000000") # set stack size to 8MB endif () diff --git a/lib/fmt b/lib/fmt index c13753a70..7f7695524 160000 --- a/lib/fmt +++ b/lib/fmt @@ -1 +1 @@ -Subproject commit c13753a70cc55f3b1c99fb8f8395e78e5f9cae43 +Subproject commit 7f7695524a4bc3c9b7883afcc86ba61421989b7f