diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d464e517e..40d046e62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1191,7 +1191,6 @@ jobs: else cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ -DUSE_CLING=OFF \ - -DUSE_REPL=ON \ -DCPPINTEROP_INCLUDE_DOCS=${{ matrix.documentation }} \ -DLLVM_DIR=$LLVM_BUILD_DIR/lib/cmake/llvm \ -DClang_DIR=$LLVM_BUILD_DIR/lib/cmake/clang \ @@ -1285,7 +1284,6 @@ jobs: { cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ` -DUSE_CLING=OFF ` - -DUSE_REPL=ON ` -DLLVM_DIR="$env:LLVM_BUILD_DIR\lib\cmake\llvm" ` -DLLVM_ENABLE_WERROR=On ` -DClang_DIR="$env:LLVM_BUILD_DIR\lib\cmake\clang" -DCODE_COVERAGE=${{ env.CODE_COVERAGE }} -DCMAKE_INSTALL_PREFIX="$env:CPPINTEROP_DIR" ..\ @@ -1580,7 +1578,6 @@ jobs: else emcmake cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ -DUSE_CLING=OFF \ - -DUSE_REPL=ON \ -DCMAKE_PREFIX_PATH=$PREFIX \ -DLLVM_DIR=$LLVM_BUILD_DIR/lib/cmake/llvm \ -DLLD_DIR=$LLVM_BUILD_DIR/lib/cmake/lld \ diff --git a/CMakeLists.txt b/CMakeLists.txt index 422625c23..883885d0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) endif() option(USE_CLING "Use Cling as backend" OFF) - option(USE_REPL "Use clang-repl as backend" OFF) + option(USE_REPL "Use clang-repl as backend" ON) if (USE_CLING AND USE_REPL) message(FATAL_ERROR "We can only use Cling (USE_CLING=On) or Repl (USE_REPL=On), but not both of them.") diff --git a/lib/Interpreter/Compatibility.h b/lib/Interpreter/Compatibility.h index 0a0dfaa4e..d6efc7324 100644 --- a/lib/Interpreter/Compatibility.h +++ b/lib/Interpreter/Compatibility.h @@ -183,7 +183,7 @@ inline void codeComplete(std::vector& Results, #endif // USE_CLING -#ifdef USE_REPL +#ifndef USE_CLING #include "DynamicLibraryManager.h" #include "clang/AST/Mangle.h" diff --git a/unittests/CppInterOp/InterpreterTest.cpp b/unittests/CppInterOp/InterpreterTest.cpp index 0d9ed77a0..22c5f0e99 100644 --- a/unittests/CppInterOp/InterpreterTest.cpp +++ b/unittests/CppInterOp/InterpreterTest.cpp @@ -7,7 +7,7 @@ #include "cling/Interpreter/Interpreter.h" #endif // USE_CLING -#ifdef USE_REPL +#ifndef USE_CLING #include "clang/Interpreter/Interpreter.h" #endif // USE_REPL @@ -111,7 +111,8 @@ TEST(InterpreterTest, CreateInterpreter) { EXPECT_TRUE(Cpp::GetNamed("cpp17")); EXPECT_FALSE(Cpp::GetNamed("cppUnknown")); -#ifdef USE_REPL + +#ifndef USE_CLING // C API auto CXI = clang_createInterpreterFromRawPtr(I); auto CLI = clang_Interpreter_getClangInterpreter(CXI); @@ -190,7 +191,7 @@ TEST(InterpreterTest, ExternalInterpreterTest) { if (llvm::sys::RunningOnValgrind()) GTEST_SKIP() << "XFAIL due to Valgrind report"; -#ifdef USE_REPL +#ifndef USE_CLING llvm::ExitOnError ExitOnErr; clang::IncrementalCompilerBuilder CB; CB.SetCompilerArgs({"-std=c++20"}); @@ -203,7 +204,7 @@ if (llvm::sys::RunningOnValgrind()) std::unique_ptr I = ExitOnErr(clang::Interpreter::create(std::move(CI))); auto ExtInterp = I.get(); -#endif +#endif // USE_REPL #ifdef USE_CLING std::string MainExecutableName = sys::fs::getMainExecutable(nullptr, nullptr); @@ -223,9 +224,10 @@ if (llvm::sys::RunningOnValgrind()) #endif EXPECT_TRUE(Cpp::GetInterpreter()) << "External Interpreter not set"; -#ifdef USE_REPL +#ifndef USE_CLING I.release(); #endif + #ifdef USE_CLING delete ExtInterp; #endif