Skip to content

Commit 59a5e99

Browse files
mcbartonvgvassilev
authored andcommitted
Remove llvm 16 and 17 compatibility
1 parent 98e07e7 commit 59a5e99

17 files changed

+10
-3506
lines changed

.github/actions/Build_LLVM/action.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +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
5246
cd build
5347
cmake -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects}}" \
5448
-DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" \
@@ -132,18 +126,6 @@ runs:
132126
}
133127
else
134128
{
135-
cp -r ..\patches\llvm\clang${{ matrix.clang-runtime }}*
136-
#FIXME: Apply patches without hardcoding
137-
if ( "${{ matrix.clang-runtime }}" -imatch "16" )
138-
{
139-
git apply -v clang16-1-Value.patch
140-
git apply -v clang16-2-CUDA.patch
141-
git apply -v clang16-3-WeakRef.patch
142-
}
143-
elseif ( "${{ matrix.clang-runtime }}" -imatch "17" )
144-
{
145-
git apply -v clang17-1-NewOperator.patch
146-
}
147129
cd build
148130
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
149131
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
@@ -56,22 +56,6 @@ jobs:
5656
cppyy: On
5757
llvm_enable_projects: "clang"
5858
llvm_targets_to_build: "host;NVPTX"
59-
- name: ubu24-arm-gcc12-clang-repl-17-cppyy
60-
os: ubuntu-24.04-arm
61-
compiler: gcc-12
62-
clang-runtime: '17'
63-
cling: Off
64-
cppyy: On
65-
llvm_enable_projects: "clang"
66-
llvm_targets_to_build: "host;NVPTX"
67-
- name: ubu24-arm-gcc12-clang-repl-16
68-
os: ubuntu-24.04-arm
69-
compiler: gcc-12
70-
clang-runtime: '16'
71-
cling: Off
72-
cppyy: Off
73-
llvm_enable_projects: "clang"
74-
llvm_targets_to_build: "host;NVPTX"
7559
- name: ubu24-arm-gcc9-clang18-cling-cppyy
7660
os: ubuntu-24.04-arm
7761
compiler: gcc-9
@@ -106,22 +90,6 @@ jobs:
10690
cppyy: On
10791
llvm_enable_projects: "clang"
10892
llvm_targets_to_build: "host;NVPTX"
109-
- name: ubu24-x86-gcc12-clang-repl-17-cppyy
110-
os: ubuntu-24.04
111-
compiler: gcc-12
112-
clang-runtime: '17'
113-
cling: Off
114-
cppyy: On
115-
llvm_enable_projects: "clang"
116-
llvm_targets_to_build: "host;NVPTX"
117-
- name: ubu24-x86-gcc12-clang-repl-16
118-
os: ubuntu-24.04
119-
compiler: gcc-12
120-
clang-runtime: '16'
121-
cling: Off
122-
cppyy: Off
123-
llvm_enable_projects: "clang"
124-
llvm_targets_to_build: "host;NVPTX"
12593
- name: ubu24-x86-gcc9-clang18-cling-cppyy
12694
os: ubuntu-24.04
12795
compiler: gcc-9
@@ -156,22 +124,6 @@ jobs:
156124
cppyy: On
157125
llvm_enable_projects: "clang"
158126
llvm_targets_to_build: "host"
159-
- name: osx15-arm-clang-clang-repl-17-cppyy
160-
os: macos-15
161-
compiler: clang
162-
clang-runtime: '17'
163-
cling: Off
164-
cppyy: On
165-
llvm_enable_projects: "clang"
166-
llvm_targets_to_build: "host"
167-
- name: osx15-arm-clang-clang-repl-16
168-
os: macos-15
169-
compiler: clang
170-
clang-runtime: '16'
171-
cling: Off
172-
cppyy: Off
173-
llvm_enable_projects: "clang"
174-
llvm_targets_to_build: "host"
175127
- name: osx15-arm-clang-clang18-cling-cppyy
176128
os: macos-15
177129
compiler: clang
@@ -206,21 +158,6 @@ jobs:
206158
cppyy: On
207159
llvm_enable_projects: "clang"
208160
llvm_targets_to_build: "host"
209-
- name: osx13-x86-clang-clang-repl-17-cppyy
210-
os: macos-13
211-
compiler: clang
212-
clang-runtime: '17'
213-
cling: Off
214-
cppyy: On
215-
llvm_enable_projects: "clang"
216-
llvm_targets_to_build: "host"
217-
- name: osx13-x86-clang-clang-repl-16
218-
os: macos-13
219-
compiler: clang
220-
clang-runtime: '16'
221-
cling: Off
222-
llvm_enable_projects: "clang"
223-
llvm_targets_to_build: "host"
224161
- name: osx13-x86-clang-clang18-cling-cppyy
225162
os: macos-13
226163
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

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

245-
## Clang 16 require c++17 or later.
233+
## Clang 18 require c++17 or later.
246234
if (NOT CMAKE_CXX_STANDARD)
247235
set (CMAKE_CXX_STANDARD 17)
248236
endif()

README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +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-
123108
##### Build Clang-REPL
124109

125110
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 & 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
******************

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"
@@ -342,7 +335,6 @@ inline void codeComplete(std::vector<std::string>& Results,
342335
clang::Interpreter& I, const char* code,
343336
unsigned complete_line = 1U,
344337
unsigned complete_column = 1U) {
345-
#if CLANG_VERSION_MAJOR >= 18
346338
// FIXME: We should match the invocation arguments of the main interpreter.
347339
// That can affect the returned completion results.
348340
auto CB = clang::IncrementalCompilerBuilder();
@@ -366,9 +358,6 @@ inline void codeComplete(std::vector<std::string>& Results,
366358
for (llvm::StringRef r : results)
367359
if (r.find(CC.Prefix) == 0)
368360
Results.push_back(r.str());
369-
#else
370-
assert(false && "CodeCompletion API only available in Clang >= 18.");
371-
#endif
372361
}
373362

374363
} // namespace compat

0 commit comments

Comments
 (0)