Rollup merge of #126536 - Rejyr:remove-unused-run-make-file, r=jieyouxu
Remove unused `llvm_readobj.rs` in `run-make-support` `llvm_readobj.rs` seems unused from the migration to `llvm.rs` in #125165. Also, `llvm.rs` was missing the drop bombs (#125752) in `llvm_readobj.rs`. Part of #121876. r? `@jieyouxu`
This commit is contained in:
commit
0ff790f60f
@ -4,18 +4,21 @@
|
||||
|
||||
/// Construct a new `llvm-readobj` invocation. This assumes that `llvm-readobj` is available
|
||||
/// at `$LLVM_BIN_DIR/llvm-readobj`.
|
||||
#[track_caller]
|
||||
pub fn llvm_readobj() -> LlvmReadobj {
|
||||
LlvmReadobj::new()
|
||||
}
|
||||
|
||||
/// Construct a new `llvm-profdata` invocation. This assumes that `llvm-profdata` is available
|
||||
/// at `$LLVM_BIN_DIR/llvm-profdata`.
|
||||
#[track_caller]
|
||||
pub fn llvm_profdata() -> LlvmProfdata {
|
||||
LlvmProfdata::new()
|
||||
}
|
||||
|
||||
/// Construct a new `llvm-filecheck` invocation. This assumes that `llvm-filecheck` is available
|
||||
/// at `$LLVM_FILECHECK`.
|
||||
#[track_caller]
|
||||
pub fn llvm_filecheck() -> LlvmFilecheck {
|
||||
LlvmFilecheck::new()
|
||||
}
|
||||
@ -55,6 +58,7 @@ pub fn llvm_bin_dir() -> PathBuf {
|
||||
impl LlvmReadobj {
|
||||
/// Construct a new `llvm-readobj` invocation. This assumes that `llvm-readobj` is available
|
||||
/// at `$LLVM_BIN_DIR/llvm-readobj`.
|
||||
#[track_caller]
|
||||
pub fn new() -> Self {
|
||||
let llvm_readobj = llvm_bin_dir().join("llvm-readobj");
|
||||
let cmd = Command::new(llvm_readobj);
|
||||
@ -77,6 +81,7 @@ pub fn file_header(&mut self) -> &mut Self {
|
||||
impl LlvmProfdata {
|
||||
/// Construct a new `llvm-profdata` invocation. This assumes that `llvm-profdata` is available
|
||||
/// at `$LLVM_BIN_DIR/llvm-profdata`.
|
||||
#[track_caller]
|
||||
pub fn new() -> Self {
|
||||
let llvm_profdata = llvm_bin_dir().join("llvm-profdata");
|
||||
let cmd = Command::new(llvm_profdata);
|
||||
@ -107,6 +112,7 @@ pub fn merge(&mut self) -> &mut Self {
|
||||
impl LlvmFilecheck {
|
||||
/// Construct a new `llvm-filecheck` invocation. This assumes that `llvm-filecheck` is available
|
||||
/// at `$LLVM_FILECHECK`.
|
||||
#[track_caller]
|
||||
pub fn new() -> Self {
|
||||
let llvm_filecheck = env_var("LLVM_FILECHECK");
|
||||
let cmd = Command::new(llvm_filecheck);
|
||||
|
@ -1,45 +0,0 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use crate::command::Command;
|
||||
use crate::env_var;
|
||||
|
||||
/// Construct a new `llvm-readobj` invocation. This assumes that `llvm-readobj` is available
|
||||
/// at `$LLVM_BIN_DIR/llvm-readobj`.
|
||||
#[track_caller]
|
||||
pub fn llvm_readobj() -> LlvmReadobj {
|
||||
LlvmReadobj::new()
|
||||
}
|
||||
|
||||
/// A `llvm-readobj` invocation builder.
|
||||
#[derive(Debug)]
|
||||
#[must_use]
|
||||
pub struct LlvmReadobj {
|
||||
cmd: Command,
|
||||
}
|
||||
|
||||
crate::impl_common_helpers!(LlvmReadobj);
|
||||
|
||||
impl LlvmReadobj {
|
||||
/// Construct a new `llvm-readobj` invocation. This assumes that `llvm-readobj` is available
|
||||
/// at `$LLVM_BIN_DIR/llvm-readobj`.
|
||||
#[track_caller]
|
||||
pub fn new() -> Self {
|
||||
let llvm_bin_dir = env_var("LLVM_BIN_DIR");
|
||||
let llvm_bin_dir = PathBuf::from(llvm_bin_dir);
|
||||
let llvm_readobj = llvm_bin_dir.join("llvm-readobj");
|
||||
let cmd = Command::new(llvm_readobj);
|
||||
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
|
||||
}
|
||||
|
||||
/// Pass `--file-header` to display file headers.
|
||||
pub fn file_header(&mut self) -> &mut Self {
|
||||
self.cmd.arg("--file-header");
|
||||
self
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user