File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
compiler/rustc_llvm/llvm-wrapper Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -149,11 +149,15 @@ extern "C" LLVMPassRef LLVMRustCreateHWAddressSanitizerPass(bool Recover) {
149
149
}
150
150
151
151
extern " C" LLVMPassRef LLVMRustCreateEntryExitInstrumenterPass (bool PostInlining) {
152
+ #if LLVM_VERSION_LT(15, 0)
152
153
if (PostInlining) {
153
154
return wrap (createPostInlineEntryExitInstrumenterPass ());
154
155
} else {
155
156
return wrap (createEntryExitInstrumenterPass ());
156
157
}
158
+ #else
159
+ report_fatal_error (" Legacy PM not supported with LLVM 15" );
160
+ #endif
157
161
}
158
162
159
163
extern " C" LLVMRustPassKind LLVMRustPassKind (LLVMPassRef RustPass) {
@@ -180,6 +184,7 @@ void LLVMRustPassManagerBuilderPopulateThinLTOPassManager(
180
184
extern " C"
181
185
void LLVMRustAddEarlyExtensionPasses (
182
186
LLVMPassManagerBuilderRef PMBR, LLVMPassRef *Passes, size_t NumPasses) {
187
+ #if LLVM_VERSION_LT(15, 0)
183
188
auto AddExtensionPasses = [Passes, NumPasses](
184
189
const PassManagerBuilder &Builder, PassManagerBase &PM) {
185
190
for (size_t I = 0 ; I < NumPasses; I++) {
@@ -190,6 +195,9 @@ void LLVMRustAddEarlyExtensionPasses(
190
195
AddExtensionPasses);
191
196
unwrap (PMBR)->addExtension (PassManagerBuilder::EP_EnabledOnOptLevel0,
192
197
AddExtensionPasses);
198
+ #else
199
+ report_fatal_error (" Legacy PM not supported with LLVM 15" );
200
+ #endif
193
201
}
194
202
195
203
extern " C"
You can’t perform that action at this time.
0 commit comments