Always use llvm.used for coverage symbols
This follows what clang does in CoverageMappingGen. Using just llvm.compiler.used is insufficient at least for MSVC targets.
This commit is contained in:
parent
f3ae726f30
commit
306259c645
6 changed files with 59 additions and 35 deletions
|
@ -162,11 +162,13 @@ pub fn compile_codegen_unit(
|
|||
cx.coverageinfo_finalize();
|
||||
}
|
||||
|
||||
// Create the llvm.compiler.used variable
|
||||
// This variable has type [N x i8*] and is stored in the llvm.metadata section
|
||||
// Create the llvm.used and llvm.compiler.used variables.
|
||||
if !cx.used_statics().borrow().is_empty() {
|
||||
cx.create_used_variable()
|
||||
}
|
||||
if !cx.compiler_used_statics().borrow().is_empty() {
|
||||
cx.create_compiler_used_variable()
|
||||
}
|
||||
|
||||
// Finalize debuginfo
|
||||
if cx.sess().opts.debuginfo != DebugInfo::None {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue