1
Fork 0

Add llvm.gcov metadata only if profiler is enabled

This commit is contained in:
Marco Castelluccio 2017-06-04 17:50:25 +01:00
parent 60524c55e9
commit a1ca5f689f

View file

@ -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;
};