diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2022-01-18 15:24:11 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2022-01-18 15:24:11 +0100 |
| commit | f3b2d37e7754458a14ac99cee970ede383eddc2f (patch) | |
| tree | 0f06412b7e7482fc12d85bdcd82dbb642a0b9a8b | |
| parent | b91ecc78bf619f3d5ad1b9b590e25f77f3ab11f6 (diff) | |
| download | rust-f3b2d37e7754458a14ac99cee970ede383eddc2f.tar.gz rust-f3b2d37e7754458a14ac99cee970ede383eddc2f.zip | |
Record object file artifact size in self profile data
| -rw-r--r-- | src/driver/aot.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/driver/aot.rs b/src/driver/aot.rs index 046e4393a68..2e047c7eea1 100644 --- a/src/driver/aot.rs +++ b/src/driver/aot.rs @@ -56,6 +56,9 @@ fn emit_module( let tmp_file = tcx.output_filenames(()).temp_path(OutputType::Object, Some(&name)); let obj = product.object.write().unwrap(); + + tcx.sess.prof.artifact_size("object_file", name.clone(), obj.len().try_into().unwrap()); + if let Err(err) = std::fs::write(&tmp_file, obj) { tcx.sess.fatal(&format!("error writing object file: {}", err)); } |
