Skip to content

Commit 2e765d0

Browse files
Dwight Guthrv-jenkins
andauthored
create conditional compilation flag for stack maps (#1088)
This is one of a sequence of PRs designed to make progress towards generating stack maps so that we can trigger the GC during allocation rather than in between rewrite steps only. The first few PRs will be preliminaries that add small features that will be used by future PRs. In this PR we are creating a cmake compilation flag that enables or disables the new gc strategy. It is disabled by default. Right now this flag is unused, but it will be used in future PRs to guard the in-progress functionality behind a flag so that it doesn't break anything. In the future, once the feature is ready for testing, we will make it enabled by default, and eventually delete the old behavior. The cmake flag can then be accessed both by cmake and as a preprocessor directive or boolean constant in C++ code. Co-authored-by: rv-jenkins <[email protected]>
1 parent 5623782 commit 2e765d0

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

cmake/KLLVMCompilerFlags.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,10 @@ include_directories(${PROJECT_SOURCE_DIR}/include)
4141
# Auto-generated header path
4242
set(KLLVM_AUTOGEN_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)
4343
include_directories(${KLLVM_AUTOGEN_INCLUDE_DIR})
44+
45+
option(K_LLVM_STACK_MAPS "Enable stack-map-based GC for the LLVM backend" OFF)
46+
if (K_LLVM_STACK_MAPS)
47+
set(K_LLVM_STACK_MAPS_FLAG "1")
48+
else()
49+
set(K_LLVM_STACK_MAPS_FLAG "0")
50+
endif()

config/macros.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,6 @@
3939
#define BACKEND_TARGET_DATALAYOUT TOSTRING(@BACKEND_TARGET_DATALAYOUT@)
4040
#define BACKEND_TARGET_TRIPLE TOSTRING(@BACKEND_TARGET_TRIPLE@)
4141

42+
#define K_LLVM_STACK_MAPS @K_LLVM_STACK_MAPS_FLAG@
43+
4244
#endif

0 commit comments

Comments
 (0)