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:
parent
5d5dc4c9d8
commit
51268d2735
6 changed files with 40 additions and 4 deletions
|
@ -39,7 +39,7 @@ pub fn finalize<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) {
|
|||
|
||||
// Encode coverage mappings and generate function records
|
||||
let mut function_data = Vec::new();
|
||||
for (instance, function_coverage) in function_coverage_map.into_iter() {
|
||||
for (instance, function_coverage) in function_coverage_map {
|
||||
debug!("Generate coverage map for: {:?}", instance);
|
||||
|
||||
let mangled_function_name = cx.tcx.symbol_name(instance).to_string();
|
||||
|
@ -172,7 +172,7 @@ impl CoverageMapGenerator {
|
|||
// as of `llvm::coverage::CovMapVersion::Version4`.
|
||||
let zero_was_n_records_val = cx.const_u32(0);
|
||||
let filenames_size_val = cx.const_u32(filenames_size as u32);
|
||||
let zero_was_coverage_size_val = cx.const_u32(0 as u32);
|
||||
let zero_was_coverage_size_val = cx.const_u32(0);
|
||||
let version_val = cx.const_u32(coverageinfo::mapping_version());
|
||||
let cov_data_header_val = cx.const_struct(
|
||||
&[zero_was_n_records_val, filenames_size_val, zero_was_coverage_size_val, version_val],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue