Add llvm.gcov metadata only if profiler is enabled
This commit is contained in:
parent
60524c55e9
commit
a1ca5f689f
1 changed files with 22 additions and 20 deletions
|
@ -806,6 +806,7 @@ pub fn compile_unit_metadata(scc: &SharedCrateContext,
|
|||
0,
|
||||
split_name.as_ptr() as *const _);
|
||||
|
||||
if sess.opts.debugging_opts.profile {
|
||||
let cu_desc_metadata = llvm::LLVMRustMetadataAsValue(debug_context.llcontext,
|
||||
unit_metadata);
|
||||
|
||||
|
@ -828,6 +829,7 @@ pub fn compile_unit_metadata(scc: &SharedCrateContext,
|
|||
llvm::LLVMAddNamedMetadataOperand(debug_context.llmod,
|
||||
llvm_gcov_ident.as_ptr(),
|
||||
gcov_metadata);
|
||||
}
|
||||
|
||||
return unit_metadata;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue