simplify a self-profiling activity call in the LLVM backend

and so that it doesn't allocate unless event argument recording is turned on
This commit is contained in:
Rémy Rakic 2022-04-01 21:01:47 +02:00
parent 7585269673
commit 3a8006714b

View File

@ -721,8 +721,7 @@ pub(crate) fn link(
let mut linker = Linker::new(first.module_llvm.llmod());
for module in elements {
let _timer =
cgcx.prof.generic_activity_with_arg("LLVM_link_module", format!("{:?}", module.name));
let _timer = cgcx.prof.generic_activity_with_arg("LLVM_link_module", &*module.name);
let buffer = ModuleBuffer::new(module.module_llvm.llmod());
linker.add(buffer.data()).map_err(|()| {
let msg = format!("failed to serialize module {:?}", module.name);