Skip to content

Commit 1e88c63

Browse files
authored
Merge branch 'main' into out-of-process
2 parents 992c497 + 59a5e99 commit 1e88c63

17 files changed

+11
-3533
lines changed

.github/actions/Build_LLVM/action.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,6 @@ runs:
4343
ninja LLVMOrcDebugging -j ${{ env.ncpus }}
4444
ninja clingInterpreter -j ${{ env.ncpus }}
4545
else
46-
# Apply patches
47-
llvm_vers=$(echo "${{ matrix.clang-runtime }}" | tr '[:lower:]' '[:upper:]')
48-
if [[ "${llvm_vers}" == "16" ]]||[[ "${llvm_vers}" == "17" ]]; then
49-
git apply -v ../patches/llvm/clang${{ matrix.clang-runtime }}-*.patch
50-
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
51-
fi
52-
if [[ "${{ matrix.oop-jit }}" == "On" ]]; then
53-
git apply -v ../patches/llvm/clang20-1-out-of-process.patch
54-
echo "Apply clang20-1-out-of-process.patch:"
55-
fi
5646
cd build
5747
cmake -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects}}" \
5848
-DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" \
@@ -144,18 +134,6 @@ runs:
144134
}
145135
else
146136
{
147-
cp -r ..\patches\llvm\clang${{ matrix.clang-runtime }}*
148-
#FIXME: Apply patches without hardcoding
149-
if ( "${{ matrix.clang-runtime }}" -imatch "16" )
150-
{
151-
git apply -v clang16-1-Value.patch
152-
git apply -v clang16-2-CUDA.patch
153-
git apply -v clang16-3-WeakRef.patch
154-
}
155-
elseif ( "${{ matrix.clang-runtime }}" -imatch "17" )
156-
{
157-
git apply -v clang17-1-NewOperator.patch
158-
}
159137
cd build
160138
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
161139
cmake -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects}}" `

.github/workflows/clang-tidy-review.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ jobs:
2323
python-version: "3.11"
2424

2525
- name: Install LLVM and Clang
26-
uses: KyleMayes/[email protected].3
26+
uses: KyleMayes/[email protected].7
2727
with:
28-
version: "17.0.6"
28+
version: "20.1.4"
2929

3030
- name: install lit
3131
run: pip install lit

.github/workflows/main.yml

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,6 @@ jobs:
4747
cppyy: On
4848
llvm_enable_projects: "clang"
4949
llvm_targets_to_build: "host;NVPTX"
50-
- name: ubu24-arm-gcc12-clang-repl-17-cppyy
51-
os: ubuntu-24.04-arm
52-
compiler: gcc-12
53-
clang-runtime: '17'
54-
cling: Off
55-
cppyy: On
56-
llvm_enable_projects: "clang"
57-
llvm_targets_to_build: "host;NVPTX"
58-
- name: ubu24-arm-gcc12-clang-repl-16
59-
os: ubuntu-24.04-arm
60-
compiler: gcc-12
61-
clang-runtime: '16'
62-
cling: Off
63-
cppyy: Off
64-
llvm_enable_projects: "clang"
65-
llvm_targets_to_build: "host;NVPTX"
6650
- name: ubu24-arm-gcc9-clang18-cling-cppyy
6751
os: ubuntu-24.04-arm
6852
compiler: gcc-9
@@ -116,22 +100,6 @@ jobs:
116100
cppyy: On
117101
llvm_enable_projects: "clang"
118102
llvm_targets_to_build: "host;NVPTX"
119-
- name: ubu24-x86-gcc12-clang-repl-17-cppyy
120-
os: ubuntu-24.04
121-
compiler: gcc-12
122-
clang-runtime: '17'
123-
cling: Off
124-
cppyy: On
125-
llvm_enable_projects: "clang"
126-
llvm_targets_to_build: "host;NVPTX"
127-
- name: ubu24-x86-gcc12-clang-repl-16
128-
os: ubuntu-24.04
129-
compiler: gcc-12
130-
clang-runtime: '16'
131-
cling: Off
132-
cppyy: Off
133-
llvm_enable_projects: "clang"
134-
llvm_targets_to_build: "host;NVPTX"
135103
- name: ubu24-x86-gcc9-clang18-cling-cppyy
136104
os: ubuntu-24.04
137105
compiler: gcc-9
@@ -175,22 +143,6 @@ jobs:
175143
cppyy: On
176144
llvm_enable_projects: "clang"
177145
llvm_targets_to_build: "host"
178-
- name: osx15-arm-clang-clang-repl-17-cppyy
179-
os: macos-15
180-
compiler: clang
181-
clang-runtime: '17'
182-
cling: Off
183-
cppyy: On
184-
llvm_enable_projects: "clang"
185-
llvm_targets_to_build: "host"
186-
- name: osx15-arm-clang-clang-repl-16
187-
os: macos-15
188-
compiler: clang
189-
clang-runtime: '16'
190-
cling: Off
191-
cppyy: Off
192-
llvm_enable_projects: "clang"
193-
llvm_targets_to_build: "host"
194146
- name: osx15-arm-clang-clang18-cling-cppyy
195147
os: macos-15
196148
compiler: clang
@@ -225,21 +177,6 @@ jobs:
225177
cppyy: On
226178
llvm_enable_projects: "clang"
227179
llvm_targets_to_build: "host"
228-
- name: osx13-x86-clang-clang-repl-17-cppyy
229-
os: macos-13
230-
compiler: clang
231-
clang-runtime: '17'
232-
cling: Off
233-
cppyy: On
234-
llvm_enable_projects: "clang"
235-
llvm_targets_to_build: "host"
236-
- name: osx13-x86-clang-clang-repl-16
237-
os: macos-13
238-
compiler: clang
239-
clang-runtime: '16'
240-
cling: Off
241-
llvm_enable_projects: "clang"
242-
llvm_targets_to_build: "host"
243180
- name: osx13-x86-clang-clang18-cling-cppyy
244181
os: macos-13
245182
compiler: clang

.readthedocs.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ build:
99
tools:
1010
python: "3.11"
1111
apt_packages:
12-
- clang-16
12+
- clang-18
1313
- cmake
14-
- libclang-16-dev
15-
- llvm-16-dev
16-
- llvm-16-tools
14+
- libclang-18-dev
15+
- llvm-18-dev
16+
- llvm-18-tools

CMakeLists.txt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,25 +67,13 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
6767
include(GNUInstallDirs)
6868
## Define supported version of clang and llvm
6969

70-
if (CPPINTEROP_USE_CLING)
7170
set(CLANG_MIN_SUPPORTED 18.0)
72-
else()
73-
set(CLANG_MIN_SUPPORTED 16.0)
74-
endif(CPPINTEROP_USE_CLING)
7571
set(CLANG_MAX_SUPPORTED "20.1.x")
7672
set(CLANG_VERSION_UPPER_BOUND 21.0.0)
77-
if (CPPINTEROP_USE_CLING)
7873
set(LLD_MIN_SUPPORTED 18.0)
79-
else()
80-
set(LLD_MIN_SUPPORTED 16.0)
81-
endif(CPPINTEROP_USE_CLING)
8274
set(LLD_MAX_SUPPORTED "20.1.x")
8375
set(LLD_VERSION_UPPER_BOUND 21.0.0)
84-
if (CPPINTEROP_USE_CLING)
8576
set(LLVM_MIN_SUPPORTED 18.0)
86-
else()
87-
set(LLVM_MIN_SUPPORTED 16.0)
88-
endif(CPPINTEROP_USE_CLING)
8977
set(LLVM_MAX_SUPPORTED "20.1.x")
9078
set(LLVM_VERSION_UPPER_BOUND 21.0.0)
9179

@@ -243,7 +231,7 @@ endif()
243231
message(STATUS "Found supported version: Clang ${CLANG_PACKAGE_VERSION}")
244232
message(STATUS "Using ClangConfig.cmake in: ${Clang_DIR}")
245233

246-
## Clang 16 require c++17 or later.
234+
## Clang 18 require c++17 or later.
247235
if (NOT CMAKE_CXX_STANDARD)
248236
set (CMAKE_CXX_STANDARD 17)
249237
endif()

README.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -105,28 +105,6 @@ git clone --depth=1 --branch release/20.x https://github.com/llvm/llvm-project.g
105105
cd llvm-project
106106
```
107107

108-
For Clang 16 & 17, the following patches required for development work. To apply these patches on Linux and MacOS execute the following command(substitute `{version}` with your clang version):
109-
110-
```bash
111-
git apply -v ../CppInterOp/patches/llvm/clang{version}-*.patch
112-
```
113-
114-
and
115-
116-
```powershell
117-
cp -r ..\CppInterOp\patches\llvm\clang{version}* .
118-
git apply -v clang{version}-*.patch
119-
```
120-
121-
on Windows.
122-
123-
If you want to have out-of-process JIT execution enabled in CppInterOp, then apply this patch on Linux and MacOS environment.
124-
> Note that this patch will not work for Windows because out-of-process JIT execution is currently implemented for Linux and MacOS only.
125-
126-
```bash
127-
git apply -v ../CppInterOp/patches/llvm/clang20-1-out-of-process.patch
128-
```
129-
130108
##### Build Clang-REPL
131109

132110
Clang-REPL is an interpreter that CppInterOp works alongside. Build Clang (and

docs/DevelopersDocumentation.rst

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,6 @@ Clone the 20.x release of the LLVM project repository.
4141
git clone --depth=1 --branch release/20.x https://github.com/llvm/llvm-project.git
4242
cd llvm-project
4343
44-
For Clang 16 & 17, the following patches required for development work. To apply
45-
these patches on Linux and MacOS execute the following command(substitute
46-
`{version}` with your clang version):
47-
48-
.. code:: bash
49-
50-
git apply -v ../CppInterOp/patches/llvm/clang{version}-*.patch
51-
52-
and
53-
54-
.. code:: powershell
55-
56-
cp -r ..\CppInterOp\patches\llvm\clang17* .
57-
git apply -v clang{version}-*.patch
58-
59-
on Windows.
60-
6144
******************
6245
Build Clang-REPL
6346
******************

docs/InstallationAndUsage.rst

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -41,32 +41,6 @@ Clone the 20.x release of the LLVM project repository.
4141
git clone --depth=1 --branch release/20.x https://github.com/llvm/llvm-project.git
4242
cd llvm-project
4343
44-
For Clang 16 & 17, the following patches required for development work. To apply
45-
these patches on Linux and MacOS execute the following command(substitute
46-
`{version}` with your clang version):
47-
48-
.. code:: bash
49-
50-
git apply -v ../CppInterOp/patches/llvm/clang{version}-*.patch
51-
52-
and
53-
54-
.. code:: powershell
55-
56-
cp -r ..\CppInterOp\patches\llvm\clang17* .
57-
git apply -v clang{version}-*.patch
58-
59-
on Windows.
60-
61-
If you want to have out-of-process JIT execution enabled in CppInterOp, then apply this patch on Linux and MacOS environment.
62-
.. note::
63-
64-
This patch will not work for Windows because out-of-process JIT execution is currently implemented for Linux and MacOS only.
65-
66-
.. code:: bash
67-
68-
git apply -v ../CppInterOp/patches/llvm/clang20-1-out-of-process.patch
69-
7044
******************
7145
Build Clang-REPL
7246
******************

lib/CppInterOp/CXCppInterOp.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ CXCursorKind cxcursor_getCursorKindForDecl(const Decl* D) {
9090
default:
9191
if (const auto* TD = dyn_cast<TagDecl>(D)) {
9292
switch (TD->getTagKind()) {
93-
#if CLANG_VERSION_MAJOR >= 18
9493
case TagTypeKind::Interface: // fall through
9594
case TagTypeKind::Struct:
9695
return CXCursor_StructDecl;
@@ -100,17 +99,6 @@ CXCursorKind cxcursor_getCursorKindForDecl(const Decl* D) {
10099
return CXCursor_UnionDecl;
101100
case TagTypeKind::Enum:
102101
return CXCursor_EnumDecl;
103-
#else
104-
case TagTypeKind::TTK_Interface: // fall through
105-
case TagTypeKind::TTK_Struct:
106-
return CXCursor_StructDecl;
107-
case TagTypeKind::TTK_Class:
108-
return CXCursor_ClassDecl;
109-
case TagTypeKind::TTK_Union:
110-
return CXCursor_UnionDecl;
111-
case TagTypeKind::TTK_Enum:
112-
return CXCursor_EnumDecl;
113-
#endif
114102
}
115103
}
116104
}

lib/CppInterOp/Compatibility.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,7 @@ static inline char* GetEnv(const char* Var_Name) {
5959
CXXSpecialMemberKind::MoveConstructor
6060
#endif
6161

62-
#if LLVM_VERSION_MAJOR < 18
63-
#define starts_with startswith
64-
#define ends_with endswith
65-
#endif
66-
67-
#if CLANG_VERSION_MAJOR >= 18
6862
#include "clang/Interpreter/CodeCompletion.h"
69-
#endif
7063

7164
#include "llvm/ADT/SmallString.h"
7265
#include "llvm/ADT/StringRef.h"
@@ -427,7 +420,6 @@ inline void codeComplete(std::vector<std::string>& Results,
427420
clang::Interpreter& I, const char* code,
428421
unsigned complete_line = 1U,
429422
unsigned complete_column = 1U) {
430-
#if CLANG_VERSION_MAJOR >= 18
431423
// FIXME: We should match the invocation arguments of the main interpreter.
432424
// That can affect the returned completion results.
433425
auto CB = clang::IncrementalCompilerBuilder();
@@ -451,9 +443,6 @@ inline void codeComplete(std::vector<std::string>& Results,
451443
for (llvm::StringRef r : results)
452444
if (r.find(CC.Prefix) == 0)
453445
Results.push_back(r.str());
454-
#else
455-
assert(false && "CodeCompletion API only available in Clang >= 18.");
456-
#endif
457446
}
458447

459448
#if defined(LLVM_BUILT_WITH_OOP_JIT) && !defined(_WIN32)

0 commit comments

Comments
 (0)