diff options
| author | Jubilee <workingjubilee@gmail.com> | 2024-09-09 00:17:48 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-09 00:17:48 -0700 |
| commit | 97d62ac2e1a6ca6e73b66498e020554ade0deeaa (patch) | |
| tree | b8c3bc092e7951ba7d6c3609ba6999f0c23bec02 /src | |
| parent | c21d31a61adee6ee365cc2a57868016832559a1b (diff) | |
| parent | ec11001f2b4b3fae70fc118ffaf533af0716d585 (diff) | |
| download | rust-97d62ac2e1a6ca6e73b66498e020554ade0deeaa.tar.gz rust-97d62ac2e1a6ca6e73b66498e020554ade0deeaa.zip | |
Rollup merge of #130048 - nebulark:runmake_llvm_pdbutil, r=jieyouxu
run-make-support: Add llvm-pdbutil Add llvm-pdbutil to run-make-support, so we can write better unit tests for PDB specific features. r? ````@jieyouxu```` ````@rustbot```` label: +O-windows
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/run-make-support/src/external_deps/llvm.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tools/run-make-support/src/external_deps/llvm.rs b/src/tools/run-make-support/src/external_deps/llvm.rs index 2522c4aeb93..16c4251998f 100644 --- a/src/tools/run-make-support/src/external_deps/llvm.rs +++ b/src/tools/run-make-support/src/external_deps/llvm.rs @@ -110,6 +110,13 @@ pub struct LlvmDwarfdump { cmd: Command, } +/// A `llvm-pdbutil` invocation builder. +#[derive(Debug)] +#[must_use] +pub struct LlvmPdbutil { + cmd: Command, +} + crate::macros::impl_common_helpers!(LlvmReadobj); crate::macros::impl_common_helpers!(LlvmProfdata); crate::macros::impl_common_helpers!(LlvmFilecheck); @@ -118,6 +125,7 @@ crate::macros::impl_common_helpers!(LlvmAr); crate::macros::impl_common_helpers!(LlvmNm); crate::macros::impl_common_helpers!(LlvmBcanalyzer); crate::macros::impl_common_helpers!(LlvmDwarfdump); +crate::macros::impl_common_helpers!(LlvmPdbutil); /// Generate the path to the bin directory of LLVM. #[must_use] @@ -360,3 +368,19 @@ impl LlvmDwarfdump { self } } + +impl LlvmPdbutil { + /// Construct a new `llvm-pdbutil` invocation. This assumes that `llvm-pdbutil` is available + /// at `$LLVM_BIN_DIR/llvm-pdbutil`. + pub fn new() -> Self { + let llvm_pdbutil = llvm_bin_dir().join("llvm-pdbutil"); + let cmd = Command::new(llvm_pdbutil); + Self { cmd } + } + + /// Provide an input file. + pub fn input<P: AsRef<Path>>(&mut self, path: P) -> &mut Self { + self.cmd.arg(path.as_ref()); + self + } +} |
