Skip to content

Commit 963a9ec

Browse files
Rollup merge of #101530 - krasimirgg:llvm-16-up, r=cuviper
llvm-wrapper: adapt for LLVM API changes No functional changes intended. Adapts PassWrapper for a few recent LLVM API changes: * llvm/llvm-project@e7bac3b * llvm/llvm-project@93600eb * llvm/llvm-project@5e38b2a Note that `ModuleMemorySanitizerPass` was renamed back to its pre-14 name, `MemorySanitizerPass`, hence the funky `#if LLVM_VERSION_GE(14, 0) && LLVM_VERSION_LT(16, 0)` guard. Found via our experimental rust + llvm at HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/13290#018315e6-24e1-44c8-b56d-9aad9be11c29
2 parents 1499c08 + a3b60f1 commit 963a9ec

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,12 +936,14 @@ LLVMRustOptimizeWithNewPassManager(
936936
/*CompileKernel=*/false);
937937
OptimizerLastEPCallbacks.push_back(
938938
[Options](ModulePassManager &MPM, OptimizationLevel Level) {
939-
#if LLVM_VERSION_GE(14, 0)
939+
#if LLVM_VERSION_GE(14, 0) && LLVM_VERSION_LT(16, 0)
940940
MPM.addPass(ModuleMemorySanitizerPass(Options));
941941
#else
942942
MPM.addPass(MemorySanitizerPass(Options));
943943
#endif
944+
#if LLVM_VERSION_LT(16, 0)
944945
MPM.addPass(createModuleToFunctionPassAdaptor(MemorySanitizerPass(Options)));
946+
#endif
945947
}
946948
);
947949
}
@@ -972,7 +974,11 @@ LLVMRustOptimizeWithNewPassManager(
972974
/*UseAfterScope=*/true,
973975
AsanDetectStackUseAfterReturnMode::Runtime,
974976
};
977+
#if LLVM_VERSION_LT(16, 0)
975978
MPM.addPass(ModuleAddressSanitizerPass(opts));
979+
#else
980+
MPM.addPass(AddressSanitizerPass(opts));
981+
#endif
976982
#else
977983
MPM.addPass(ModuleAddressSanitizerPass(
978984
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover));

0 commit comments

Comments
 (0)