Check for LLVM 11+ when using -Z instrument-coverage
* `rustc` should now compile under LLVM 9 or 10 * Compiler generates an error if `-Z instrument-coverage` is specified but LLVM version is less than 11 * Coverage tests that require `-Z instrument-coverage` and run codegen should be skipped if LLVM version is less than 11
This commit is contained in:
@@ -71,7 +71,11 @@ extern "C" void LLVMRustCoverageWriteMapSectionNameToString(LLVMModuleRef M,
|
||||
|
||||
extern "C" void LLVMRustCoverageWriteFuncSectionNameToString(LLVMModuleRef M,
|
||||
RustStringRef Str) {
|
||||
#if LLVM_VERSION_GE(11, 0)
|
||||
WriteSectionNameToString(M, IPSK_covfun, Str);
|
||||
#else
|
||||
report_fatal_error("rustc option `-Z instrument-coverage` requires LLVM 11 or higher.");
|
||||
#endif
|
||||
}
|
||||
|
||||
extern "C" void LLVMRustCoverageWriteMappingVarNameToString(RustStringRef Str) {
|
||||
@@ -81,5 +85,9 @@ extern "C" void LLVMRustCoverageWriteMappingVarNameToString(RustStringRef Str) {
|
||||
}
|
||||
|
||||
extern "C" uint32_t LLVMRustCoverageMappingVersion() {
|
||||
#if LLVM_VERSION_GE(11, 0)
|
||||
return coverage::CovMapVersion::Version4;
|
||||
#else
|
||||
report_fatal_error("rustc option `-Z instrument-coverage` requires LLVM 11 or higher.");
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user