File tree Expand file tree Collapse file tree 5 files changed +29
-21
lines changed Expand file tree Collapse file tree 5 files changed +29
-21
lines changed Original file line number Diff line number Diff line change 1616 build :
1717 runs-on : ${{ matrix.os }}
1818
19- name : " ${{ matrix.cpp_compiler }}- ${{ matrix.os }}- ${{ matrix.build_type }}"
19+ name : " ${{ matrix.os }}( ${{ matrix.build_type }}, LLVM: ${{ matrix.llvm_backend }}) "
2020
2121 strategy :
2222 # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
3131 matrix :
3232 os : [ubuntu-latest]
3333 build_type : [RelWithDebInfo]
34+ llvm_backend : [ON,OFF]
3435
3536 steps :
3637 - uses : actions/checkout@v3
9091 -DCMAKE_CXX_COMPILER=clang++-18
9192 -DCMAKE_C_COMPILER=clang-18
9293 -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
94+ -DENDO_USE_LLVM=${{ matrix.llvm_backend }}
9395 -GNinja
9496 -S ${{ github.workspace }}
9597
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
1111set (CMAKE_CXX_EXTENSIONS OFF )
1212set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
1313
14-
1514option (ENDO_USE_LLVM "Use llvm as a backend for the shell" ON )
1615
1716if (NOT DEFINED ENDO_TRACE_VM)
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ target_sources(Shell
1515 ASTPrinter.cpp
1616 IRGenerator.cpp
1717 Parser.cpp
18- llvm_executor.cpp
1918)
2019
2120find_package (Threads REQUIRED)
@@ -35,24 +34,24 @@ set(shell_libs
3534
3635
3736if (ENDO_USE_LLVM)
38- find_package (LLVM)
39- if (LLVM_FOUND)
37+ find_package (LLVM REQUIRED)
38+ message (STATUS "Found LLVM ${LLVM_PACKAGE_VERSION} " )
39+ message (STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR} " )
40+ include ("${LLVM_DIR} /AddLLVM.cmake" )
4041
41- message (STATUS "Found LLVM ${LLVM_PACKAGE_VERSION} " )
42- message (STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR} " )
43- include ("${LLVM_DIR} /AddLLVM.cmake" )
44-
45- include_directories (${LLVM_INCLUDE_DIRS} )
46- add_definitions (${LLVM_DEFINITIONS} )
47- llvm_map_components_to_libnames(llvm_libs analysis core executionengine instcombine object orcjit runtimedyld scalaropts support native)
42+ include_directories (${LLVM_INCLUDE_DIRS} )
43+ add_definitions (${LLVM_DEFINITIONS} )
44+ llvm_map_components_to_libnames(llvm_libs analysis core executionengine instcombine object orcjit runtimedyld scalaropts support native)
4845 # Link against LLVM libraries
49- set (shell_libs
50- ${shell_libs}
51- ${llvm_libs} )
46+ set (shell_libs
47+ ${shell_libs}
48+ ${llvm_libs} )
5249
53- target_compile_definitions (Shell PUBLIC ENDO_USE_LLVM)
54- endif ()
55- else ()
50+ target_sources (Shell
51+ PUBLIC
52+ FILE_SET CXX_MODULES FILES
53+ llvm_executor.cpp)
54+ target_compile_definitions (Shell PUBLIC ENDO_USE_LLVM)
5655endif ()
5756
5857
Original file line number Diff line number Diff line change 11// SPDX-License-Identifier: Apache-2.0
22module ;
33#include < shell/ProcessGroup.h>
4+
45#include < crispy/assert.h>
56#include < crispy/utils.h>
67
@@ -21,7 +22,9 @@ import IRGenerator;
2122import Parser;
2223import CoreVM;
2324
25+ #if defined(ENDO_USE_LLVM)
2426import LLVMBackend;
27+ #endif
2528
2629export module Shell;
2730
@@ -171,7 +174,13 @@ export class SystemEnvironment: public Environment
171174export class Shell final : public CoreVM::Runtime
172175{
173176 public:
174- Shell (): Shell(RealTTY::instance(), SystemEnvironment::instance()) {}
177+ Shell (): Shell(RealTTY::instance(), SystemEnvironment::instance())
178+ {
179+
180+ #if defined(ENDO_USE_LLVM)
181+ LLVMBackend::init ();
182+ #endif
183+ }
175184
176185 Shell (TTY& tty, Environment& env): _env { env }, _tty { tty }
177186 {
Original file line number Diff line number Diff line change 44using namespace std ::string_literals;
55
66import Shell;
7- import LLVMBackend;
7+
88
99std::string_view getEnvironment (std::string_view name, std::string_view defaultValue)
1010{
@@ -18,7 +18,6 @@ int main(int argc, char const* argv[])
1818
1919 setsid ();
2020
21- LLVMBackend::init ();
2221
2322 if (argc == 2 )
2423 // This here only exists for early-development debugging purposes.
You can’t perform that action at this time.
0 commit comments