Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions compiler/rustc_codegen_llvm/src/back/command_line_args.rs

This file was deleted.

25 changes: 0 additions & 25 deletions compiler/rustc_codegen_llvm/src/back/command_line_args/tests.rs

This file was deleted.

1 change: 0 additions & 1 deletion compiler/rustc_codegen_llvm/src/back/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pub(crate) mod archive;
mod command_line_args;
pub(crate) mod lto;
pub(crate) mod owned_target_machine;
mod profiling;
Expand Down
6 changes: 0 additions & 6 deletions compiler/rustc_codegen_llvm/src/back/owned_target_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ impl OwnedTargetMachine {
output_obj_file: &CStr,
debug_info_compression: &CStr,
use_emulated_tls: bool,
argv0: &str,
command_line_args: &str,
use_wasm_eh: bool,
) -> Result<Self, LlvmError<'static>> {
// SAFETY: llvm::LLVMRustCreateTargetMachine copies pointed to data
Expand All @@ -66,10 +64,6 @@ impl OwnedTargetMachine {
output_obj_file.as_ptr(),
debug_info_compression.as_ptr(),
use_emulated_tls,
argv0.as_ptr(),
argv0.len(),
command_line_args.as_ptr(),
command_line_args.len(),
use_wasm_eh,
)
};
Expand Down
16 changes: 0 additions & 16 deletions compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ use rustc_span::{BytePos, InnerSpan, Pos, SpanData, SyntaxContext, sym};
use rustc_target::spec::{CodeModel, FloatAbi, RelocModel, SanitizerSet, SplitDebuginfo, TlsModel};
use tracing::{debug, trace};

use crate::back::command_line_args::quote_command_line_args;
use crate::back::lto::ThinBuffer;
use crate::back::owned_target_machine::OwnedTargetMachine;
use crate::back::profiling::{
Expand Down Expand Up @@ -253,19 +252,6 @@ pub(crate) fn target_machine_factory(

let use_emulated_tls = matches!(sess.tls_model(), TlsModel::Emulated);

// 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);
// Self-profile counter for the number of bytes produced by command-line quoting.
// Values are summed, so the summary result is cumulative across all TM factories.
sess.prof.artifact_size("quoted_command_line_args", "-", command_line_args.len() as u64);

let debuginfo_compression = sess.opts.debuginfo_compression.to_string();
match sess.opts.debuginfo_compression {
rustc_session::config::DebugInfoCompression::Zlib => {
Expand Down Expand Up @@ -326,8 +312,6 @@ pub(crate) fn target_machine_factory(
&output_obj_file,
&debuginfo_compression,
use_emulated_tls,
&argv0,
&command_line_args,
use_wasm_eh,
)
})
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_codegen_llvm/src/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2492,10 +2492,6 @@ unsafe extern "C" {
OutputObjFile: *const c_char,
DebugInfoCompression: *const c_char,
UseEmulatedTls: bool,
Argv0: *const c_uchar, // See "PTR_LEN_STR".
Argv0Len: size_t,
CommandLineArgs: *const c_uchar, // See "PTR_LEN_STR".
CommandLineArgsLen: size_t,
UseWasmEH: bool,
) -> *mut TargetMachine;

Expand Down
7 changes: 0 additions & 7 deletions compiler/rustc_codegen_ssa/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,6 @@ pub struct CodegenContext<B: WriteBackendMethods> {
pub split_dwarf_kind: rustc_session::config::SplitDwarfKind,
pub pointer_size: Size,

/// All commandline args used to invoke the compiler, with @file args fully expanded.
/// This will only be used within debug info, e.g. in the pdb file on windows
/// This is mainly useful for other tools that reads that debuginfo to figure out
/// how to call the compiler with the same arguments.
pub expanded_args: Vec<String>,

/// Emitter to use for diagnostics produced during codegen.
pub diag_emitter: SharedEmitter,
/// LLVM optimizations for which we want to print remarks.
Expand Down Expand Up @@ -1153,7 +1147,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
remark: sess.opts.cg.remark.clone(),
remark_dir,
incr_comp_session_dir: sess.incr_comp_session_dir_opt().map(|r| r.clone()),
expanded_args: tcx.sess.expanded_args.clone(),
diag_emitter: shared_emitter.clone(),
output_filenames: Arc::clone(tcx.output_filenames(())),
module_config: regular_config,
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send))
make_codegen_backend: None,
registry: diagnostics_registry(),
using_internal_features: &USING_INTERNAL_FEATURES,
expanded_args: args,
};

callbacks.config(&mut config);
Expand Down
7 changes: 0 additions & 7 deletions compiler/rustc_interface/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,6 @@ pub struct Config {
/// enabled. Makes it so that "please report a bug" is hidden, as ICEs with
/// internal features are wontfix, and they are usually the cause of the ICEs.
pub using_internal_features: &'static std::sync::atomic::AtomicBool,

/// All commandline args used to invoke the compiler, with @file args fully expanded.
/// This will only be used within debug info, e.g. in the pdb file on windows
/// This is mainly useful for other tools that reads that debuginfo to figure out
/// how to call the compiler with the same arguments.
pub expanded_args: Vec<String>,
}

/// Initialize jobserver before getting `jobserver::client` and `build_session`.
Expand Down Expand Up @@ -480,7 +474,6 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
util::rustc_version_str().unwrap_or("unknown"),
config.ice_file,
config.using_internal_features,
config.expanded_args,
);

codegen_backend.init(&sess);
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_interface/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ where
"",
None,
&USING_INTERNAL_FEATURES,
Default::default(),
);
let cfg = parse_cfg(sess.dcx(), matches.opt_strs("cfg"));
let cfg = build_configuration(&sess, cfg);
Expand Down
9 changes: 1 addition & 8 deletions compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,7 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
bool TrapUnreachable, bool Singlethread, bool VerboseAsm,
bool EmitStackSizeSection, bool RelaxELFRelocations, bool UseInitArray,
const char *SplitDwarfFile, const char *OutputObjFile,
const char *DebugInfoCompression, bool UseEmulatedTls, const char *Argv0,
size_t Argv0Len, const char *CommandLineArgs, size_t CommandLineArgsLen,
bool UseWasmEH) {
const char *DebugInfoCompression, bool UseEmulatedTls, bool UseWasmEH) {

auto OptLevel = fromRust(RustOptLevel);
auto RM = fromRust(RustReloc);
Expand Down Expand Up @@ -344,11 +342,6 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(

Options.EmitStackSizeSection = EmitStackSizeSection;

if (Argv0 != nullptr)
Options.MCOptions.Argv0 = {Argv0, Argv0Len};
if (CommandLineArgs != nullptr)
Options.MCOptions.CommandlineArgs = {CommandLineArgs, CommandLineArgsLen};

#if LLVM_VERSION_GE(21, 0)
TargetMachine *TM = TheTarget->createTargetMachine(Trip, CPU, Feature,
Options, RM, CM, OptLevel);
Expand Down
8 changes: 0 additions & 8 deletions compiler/rustc_session/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,6 @@ pub struct Session {
/// None signifies that this is not tracked.
pub using_internal_features: &'static AtomicBool,

/// All commandline args used to invoke the compiler, with @file args fully expanded.
/// This will only be used within debug info, e.g. in the pdb file on windows
/// This is mainly useful for other tools that reads that debuginfo to figure out
/// how to call the compiler with the same arguments.
pub expanded_args: Vec<String>,

target_filesearch: FileSearch,
host_filesearch: FileSearch,

Expand Down Expand Up @@ -1015,7 +1009,6 @@ pub fn build_session(
cfg_version: &'static str,
ice_file: Option<PathBuf>,
using_internal_features: &'static AtomicBool,
expanded_args: Vec<String>,
) -> Session {
// FIXME: This is not general enough to make the warning lint completely override
// normal diagnostic warnings, since the warning lint can also be denied and changed
Expand Down Expand Up @@ -1132,7 +1125,6 @@ pub fn build_session(
unstable_target_features: Default::default(),
cfg_version,
using_internal_features,
expanded_args,
target_filesearch,
host_filesearch,
invocation_temp,
Expand Down
7 changes: 0 additions & 7 deletions src/librustdoc/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,6 @@ pub(crate) struct Options {
/// to have it in both places.
pub(crate) unstable_features: rustc_feature::UnstableFeatures,

/// All commandline args used to invoke the compiler, with @file args fully expanded.
/// This will only be used within debug info, e.g. in the pdb file on windows
/// This is mainly useful for other tools that reads that debuginfo to figure out
/// how to call the compiler with the same arguments.
pub(crate) expanded_args: Vec<String>,

/// Arguments to be used when compiling doctests.
pub(crate) doctest_build_args: Vec<String>,

Expand Down Expand Up @@ -870,7 +864,6 @@ impl Options {
json_unused_externs,
scrape_examples_options,
unstable_features,
expanded_args: args,
doctest_build_args,
target_modifiers,
};
Expand Down
2 changes: 0 additions & 2 deletions src/librustdoc/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ pub(crate) fn create_config(
describe_lints,
lint_cap,
scrape_examples_options,
expanded_args,
remap_path_prefix,
target_modifiers,
..
Expand Down Expand Up @@ -326,7 +325,6 @@ pub(crate) fn create_config(
registry: rustc_driver::diagnostics_registry(),
ice_file: None,
using_internal_features: &USING_INTERNAL_FEATURES,
expanded_args,
}
}

Expand Down
1 change: 0 additions & 1 deletion src/librustdoc/doctest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ pub(crate) fn run(dcx: DiagCtxtHandle<'_>, input: Input, options: RustdocOptions
registry: rustc_driver::diagnostics_registry(),
ice_file: None,
using_internal_features: &rustc_driver::USING_INTERNAL_FEATURES,
expanded_args: options.expanded_args.clone(),
};

let externs = options.externs.clone();
Expand Down
4 changes: 0 additions & 4 deletions tests/run-make/pdb-buildinfo-cl-cmd/filecheck.txt

This file was deleted.

1 change: 0 additions & 1 deletion tests/run-make/pdb-buildinfo-cl-cmd/main.rs

This file was deleted.

25 changes: 0 additions & 25 deletions tests/run-make/pdb-buildinfo-cl-cmd/rmake.rs

This file was deleted.

Loading