diff options
| author | bors <bors@rust-lang.org> | 2023-09-08 10:06:40 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-09-08 10:06:40 +0000 |
| commit | 9be4eac2647432aa863f65da8a116f2eafd90ee9 (patch) | |
| tree | e3e314564294f95fa70e26dff6a5f68f4386be09 /src | |
| parent | de4cba3a98a15a891ad708a049c7fb5682083d97 (diff) | |
| parent | 4cdc633301e3c760fb36470afc216a9e09351fa3 (diff) | |
| download | rust-9be4eac2647432aa863f65da8a116f2eafd90ee9.tar.gz rust-9be4eac2647432aa863f65da8a116f2eafd90ee9.zip | |
Auto merge of #113492 - nebulark:pr_96475, r=petrochenkov
Add CL and CMD into to pdb debug info Partial fix for https://github.com/rust-lang/rust/issues/96475 The Arg0 and CommandLineArgs of the MCTargetOptions cpp class are not set within https://github.com/rust-lang/rust/blob/bb548f964572f7fe652716f5897d9050a31c936e/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp#L378 This causes LLVM to not neither output any compiler path (cl) nor the arguments that were used when invoking it (cmd) in the PDB file. This fix adds the missing information to the target machine so LLVM can use it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/config.rs | 7 | ||||
| -rw-r--r-- | src/librustdoc/core.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/doctest.rs | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs index 1ce7efdfc20..974dc1c5135 100644 --- a/src/librustdoc/config.rs +++ b/src/librustdoc/config.rs @@ -157,6 +157,12 @@ pub(crate) struct Options { /// Note: this field is duplicated in `RenderOptions` because it's useful /// 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>, } impl fmt::Debug for Options { @@ -744,6 +750,7 @@ impl Options { json_unused_externs, scrape_examples_options, unstable_features, + expanded_args: args, }; let render_options = RenderOptions { output, diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index eadff37b592..7cd25ef444b 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -194,6 +194,7 @@ pub(crate) fn create_config( describe_lints, lint_cap, scrape_examples_options, + expanded_args, .. }: RustdocOptions, RenderOptions { document_private, .. }: &RenderOptions, @@ -291,6 +292,7 @@ pub(crate) fn create_config( make_codegen_backend: None, registry: rustc_driver::diagnostics_registry(), ice_file: None, + expanded_args, } } diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs index 36d5adb6304..bb7d26c541b 100644 --- a/src/librustdoc/doctest.rs +++ b/src/librustdoc/doctest.rs @@ -109,6 +109,7 @@ pub(crate) fn run(options: RustdocOptions) -> Result<(), ErrorGuaranteed> { make_codegen_backend: None, registry: rustc_driver::diagnostics_registry(), ice_file: None, + expanded_args: options.expanded_args.clone(), }; let test_args = options.test_args.clone(); |
