Skip to content

Commit

Permalink
run-make-support: Add llvm-pdbutil
Browse files Browse the repository at this point in the history
  • Loading branch information
nebulark committed Sep 6, 2024
1 parent eb33b43 commit cf8b87b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/tools/run-make-support/src/external_deps/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ pub struct LlvmDwarfdump {
cmd: Command,
}

/// A `llvm-dwarfdump` 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);
Expand All @@ -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]
Expand Down Expand Up @@ -359,3 +367,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
}
}

0 comments on commit cf8b87b

Please sign in to comment.