From 6765a77520bd67f65c7e754b82652c448c53fca9 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Mon, 22 Sep 2025 13:56:17 +1000 Subject: [PATCH] (DO NOT MERGE) What happens to perf if we don't supply quoted args at all? This demonstrates the theoretical limits of optimizing the quoting process. --- compiler/rustc_codegen_llvm/src/back/write.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs index c4881f0aafc80..6b7f9bdd9d240 100644 --- a/compiler/rustc_codegen_llvm/src/back/write.rs +++ b/compiler/rustc_codegen_llvm/src/back/write.rs @@ -253,12 +253,16 @@ pub(crate) fn target_machine_factory( // Command-line information to be included in the target machine. // This seems to only be used for embedding in PDB debuginfo files. // FIXME(Zalathar): Maybe skip this for non-PDB targets? - let argv0 = std::env::current_exe() - .unwrap_or_default() - .into_os_string() - .into_string() - .unwrap_or_default(); - let command_line_args = quote_command_line_args(&sess.expanded_args); + if false { + let _argv0 = std::env::current_exe() + .unwrap_or_default() + .into_os_string() + .into_string() + .unwrap_or_default(); + let _command_line_args = quote_command_line_args(&sess.expanded_args); + } + let argv0 = String::new(); + let command_line_args = String::new(); let debuginfo_compression = sess.opts.debuginfo_compression.to_string(); match sess.opts.debuginfo_compression {