Skip to content

Commit 2fe65fc

Browse files
committed
[patch] Fix ci for Cling v1.2
1 parent 90d4bf0 commit 2fe65fc

File tree

8 files changed

+56
-0
lines changed

8 files changed

+56
-0
lines changed

.github/workflows/MacOS-arm.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ jobs:
166166
git clone https://github.com/root-project/cling.git
167167
cd ./cling
168168
git checkout tags/v${{ matrix.cling-version }}
169+
git apply -v ../patches/llvm/cling1.2-LookupHelper.patch
169170
cd ..
170171
git clone --depth=1 -b cling-llvm${{ matrix.clang-runtime }} https://github.com/root-project/llvm-project.git
171172
else # repl
@@ -192,6 +193,7 @@ jobs:
192193
-G Ninja \
193194
../llvm
194195
ninja clang -j ${{ env.ncpus }}
196+
ninja LLVMOrcDebugging -j ${{ env.ncpus }}
195197
ninja clingInterpreter -j ${{ env.ncpus }}
196198
else
197199
# Apply patches

.github/workflows/MacOS.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ jobs:
150150
git clone https://github.com/root-project/cling.git
151151
cd ./cling
152152
git checkout tags/v${{ matrix.cling-version }}
153+
git apply -v ../patches/llvm/cling1.2-LookupHelper.patch
153154
cd ..
154155
git clone --depth=1 -b cling-llvm${{ matrix.clang-runtime }} https://github.com/root-project/llvm-project.git
155156
else # repl
@@ -176,6 +177,7 @@ jobs:
176177
-G Ninja \
177178
../llvm
178179
ninja clang -j ${{ env.ncpus }}
180+
ninja LLVMOrcDebugging -j ${{ env.ncpus }}
179181
ninja clingInterpreter -j ${{ env.ncpus }}
180182
else
181183
# Apply patches

.github/workflows/Ubuntu-arm.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ jobs:
161161
git clone https://github.com/root-project/cling.git
162162
cd ./cling
163163
git checkout tags/v${{ matrix.cling-version }}
164+
git apply -v ../patches/llvm/cling1.2-LookupHelper.patch
164165
cd ..
165166
git clone --depth=1 -b cling-llvm${{ matrix.clang-runtime }} https://github.com/root-project/llvm-project.git
166167
else # repl
@@ -187,6 +188,7 @@ jobs:
187188
-G Ninja \
188189
../llvm
189190
ninja clang -j ${{ env.ncpus }}
191+
ninja LLVMOrcDebugging -j ${{ env.ncpus }}
190192
ninja clingInterpreter -j ${{ env.ncpus }}
191193
else
192194
# Apply patches

.github/workflows/Ubuntu.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ jobs:
154154
git clone https://github.com/root-project/cling.git
155155
cd ./cling
156156
git checkout tags/v${{ matrix.cling-version }}
157+
git apply -v ../patches/llvm/cling1.2-LookupHelper.patch
157158
cd ..
158159
git clone --depth=1 -b cling-llvm${{ matrix.clang-runtime }} https://github.com/root-project/llvm-project.git
159160
else # repl
@@ -180,6 +181,7 @@ jobs:
180181
-G Ninja \
181182
../llvm
182183
ninja clang -j ${{ env.ncpus }}
184+
ninja LLVMOrcDebugging -j ${{ env.ncpus }}
183185
ninja clingInterpreter -j ${{ env.ncpus }}
184186
else
185187
# Apply patches

.github/workflows/Windows-arm.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ jobs:
130130
git clone https://github.com/root-project/cling.git
131131
cd ./cling
132132
git checkout tags/v${{ matrix.cling-version }}
133+
git apply -v ../patches/llvm/cling1.2-LookupHelper.patch
133134
cd ..
134135
git clone --depth=1 -b cling-llvm${{ matrix.clang-runtime }} https://github.com/root-project/llvm-project.git
135136
$env:PWD_DIR= $PWD.Path
@@ -162,6 +163,7 @@ jobs:
162163
-DLLVM_ENABLE_LIBXML2=OFF `
163164
..\llvm
164165
cmake --build . --config Release --target clang --parallel ${{ env.ncpus }}
166+
cmake --build . --config Release --target LLVMOrcDebugging --parallel ${{ env.ncpus }}
165167
cmake --build . --config Release --target clingInterpreter --parallel ${{ env.ncpus }}
166168
}
167169
else

.github/workflows/Windows.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ jobs:
130130
git clone https://github.com/root-project/cling.git
131131
cd ./cling
132132
git checkout tags/v${{ matrix.cling-version }}
133+
git apply -v ../patches/llvm/cling1.2-LookupHelper.patch
133134
cd ..
134135
git clone --depth=1 -b cling-llvm${{ matrix.clang-runtime }} https://github.com/root-project/llvm-project.git
135136
$env:PWD_DIR= $PWD.Path
@@ -162,6 +163,7 @@ jobs:
162163
-DLLVM_ENABLE_LIBXML2=OFF `
163164
..\llvm
164165
cmake --build . --config Release --target clang --parallel ${{ env.ncpus }}
166+
cmake --build . --config Release --target LLVMOrcDebugging --parallel ${{ env.ncpus }}
165167
cmake --build . --config Release --target clingInterpreter --parallel ${{ env.ncpus }}
166168
}
167169
else

.github/workflows/emscripten.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ jobs:
211211
git clone https://github.com/root-project/cling.git
212212
cd ./cling
213213
git checkout tags/v${{ matrix.cling-version }}
214+
git apply -v ../patches/llvm/cling1.2-LookupHelper.patch
214215
cd ..
215216
git clone --depth=1 -b cling-llvm${{ matrix.clang-runtime }} https://github.com/root-project/llvm-project.git
216217
else # repl
@@ -304,6 +305,7 @@ jobs:
304305
git clone https://github.com/root-project/cling.git
305306
cd ./cling
306307
git checkout tags/v${{ matrix.cling-version }}
308+
git apply -v ../patches/llvm/cling1.2-LookupHelper.patch
307309
cd ..
308310
git clone --depth=1 -b cling-llvm${{ matrix.clang-runtime }} https://github.com/root-project/llvm-project.git
309311
$env:PWD_DIR= $PWD.Path
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
diff --git a/include/cling/Interpreter/LookupHelper.h b/include/cling/Interpreter/LookupHelper.h
2+
index 6e6e2814..cd79b2a6 100644
3+
--- a/include/cling/Interpreter/LookupHelper.h
4+
+++ b/include/cling/Interpreter/LookupHelper.h
5+
@@ -56,7 +56,7 @@ namespace cling {
6+
WithDiagnostics
7+
};
8+
private:
9+
- std::unique_ptr<clang::Parser> m_Parser;
10+
+ clang::Parser* m_Parser;
11+
Interpreter* m_Interpreter; // we do not own.
12+
std::array<const clang::Type*, kNumCachedStrings> m_StringTy = {{}};
13+
/// A map containing the hash of the lookup buffer. This allows us to avoid
14+
diff --git a/lib/Interpreter/Interpreter.cpp b/lib/Interpreter/Interpreter.cpp
15+
index 6af90108..89ca360b 100644
16+
--- a/lib/Interpreter/Interpreter.cpp
17+
+++ b/lib/Interpreter/Interpreter.cpp
18+
@@ -265,13 +265,6 @@ namespace cling {
19+
}
20+
21+
Sema& SemaRef = getSema();
22+
- Preprocessor& PP = SemaRef.getPreprocessor();
23+
-
24+
- m_LookupHelper.reset(new LookupHelper(new Parser(PP, SemaRef,
25+
- /*SkipFunctionBodies*/false,
26+
- /*isTemp*/true), this));
27+
- if (!m_LookupHelper)
28+
- return;
29+
30+
if (!isInSyntaxOnlyMode() && !m_Opts.CompilerOpts.CUDADevice) {
31+
m_Executor.reset(new IncrementalExecutor(SemaRef.Diags, *getCI(),
32+
@@ -317,6 +310,10 @@ namespace cling {
33+
return;
34+
}
35+
36+
+ m_LookupHelper.reset(new LookupHelper(m_IncrParser->getParser(), this));
37+
+ if (!m_LookupHelper)
38+
+ return;
39+
+
40+
// When not using C++ modules, we now have a PCH and we can safely setup
41+
// our callbacks without fearing that they get overwritten by clang code.
42+
// The modules setup is handled above.

0 commit comments

Comments
 (0)