Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperFola committed Sep 24, 2024
1 parent fab7808 commit a547cf7
Show file tree
Hide file tree
Showing 4 changed files with 420 additions and 319 deletions.
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ target_include_directories(ArkReactor
target_compile_features(ArkReactor PRIVATE cxx_std_20)

if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG OR APPLE)
message(STATUS "Enabling computed gotos")
target_compile_definitions(ArkReactor PRIVATE ARK_USE_COMPUTED_GOTOS=1)

target_compile_options(ArkReactor
PUBLIC
-Wall -Wextra -pedantic -Wstrict-aliasing
Expand All @@ -68,6 +71,8 @@ if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG OR APPLE)
-Wno-unknown-pragmas
# Disable warnings about disabling warnings we have disabled.
-Wno-unknown-warning-option
# For our computed gotos needs
-Wno-gnu-label-as-value
)

if (APPLE)
Expand All @@ -91,13 +96,14 @@ if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG OR APPLE)

# The nlohmann/json.hpp external project has unused typedefs in the code
# to compensate for this error we remove the following warning.
if (CMAKE_COMPILER_IS_CLANG OR APPLE)
if (CMAKE_COMPILER_IS_CLANG)
target_compile_options(ArkReactor PUBLIC -Wno-unused-local-typedef)
elseif (CMAKE_COMPILER_IS_GNUCXX)
target_compile_options(ArkReactor PUBLIC -Wno-unused-local-typedefs)
endif ()

elseif (MSVC)
target_compile_definitions(ArkReactor PRIVATE ARK_USE_COMPUTED_GOTOS=0)
target_compile_options(ArkReactor
PUBLIC
/W4
Expand Down Expand Up @@ -152,11 +158,11 @@ endif ()
target_compile_definitions(ArkReactor PRIVATE ARK_EXPORT)

if (ARK_ENABLE_SYSTEM)
target_compile_definitions(ArkReactor PRIVATE -DARK_ENABLE_SYSTEM)
target_compile_definitions(ArkReactor PRIVATE ARK_ENABLE_SYSTEM)
endif ()

if (ARK_PROFILER_MIPS)
target_compile_definitions(ArkReactor PRIVATE -DARK_PROFILER_MIPS)
target_compile_definitions(ArkReactor PRIVATE ARK_PROFILER_MIPS)
endif ()

if (ARK_BUILD_MODULES)
Expand Down
52 changes: 26 additions & 26 deletions include/Ark/Compiler/Instructions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,33 +61,33 @@ namespace Ark::internal
DUP = 0x1a,
LAST_COMMAND = 0x1a,

FIRST_OPERATOR = 0x20,
ADD = 0x20,
SUB = 0x21,
MUL = 0x22,
DIV = 0x23,
GT = 0x24,
LT = 0x25,
LE = 0x26,
GE = 0x27,
NEQ = 0x28,
EQ = 0x29,
LEN = 0x2a,
EMPTY = 0x2b,
TAIL = 0x2c,
HEAD = 0x2d,
ISNIL = 0x2e,
ASSERT = 0x2f,
TO_NUM = 0x30,
TO_STR = 0x31,
AT = 0x32,
MOD = 0x33,
TYPE = 0x34,
HASFIELD = 0x35,
NOT = 0x36,
LAST_OPERATOR = 0x36,
FIRST_OPERATOR = 0x1b,
ADD = 0x1b,
SUB = 0x1c,
MUL = 0x1d,
DIV = 0x1e,
GT = 0x1f,
LT = 0x20,
LE = 0x21,
GE = 0x22,
NEQ = 0x23,
EQ = 0x24,
LEN = 0x25,
EMPTY = 0x26,
TAIL = 0x27,
HEAD = 0x28,
ISNIL = 0x29,
ASSERT = 0x2a,
TO_NUM = 0x2b,
TO_STR = 0x2c,
AT = 0x2d,
MOD = 0x2e,
TYPE = 0x2f,
HASFIELD = 0x30,
NOT = 0x31,
LAST_OPERATOR = 0x31,

LAST_INSTRUCTION = 0x36
LAST_INSTRUCTION = 0x31
};
}

Expand Down
Loading

0 comments on commit a547cf7

Please sign in to comment.