about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-07-30 16:27:29 -0400
committerOneirical <manchot@videotron.ca>2024-08-12 10:27:20 -0400
commitfe52572a4aa5e81bb9c7bc56306271cd3045477c (patch)
treedf949cc96705a811e8af9a3ce02841ec5ed52e59 /src
parente08b80c0fb7667bdcd040761891701e576c42ec8 (diff)
downloadrust-fe52572a4aa5e81bb9c7bc56306271cd3045477c.tar.gz
rust-fe52572a4aa5e81bb9c7bc56306271cd3045477c.zip
rewrite remap-path-prefix-dwarf to rmake
Diffstat (limited to 'src')
-rw-r--r--src/tools/run-make-support/src/external_deps/llvm.rs30
-rw-r--r--src/tools/run-make-support/src/lib.rs5
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
3 files changed, 33 insertions, 3 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 dc651fdd820..7af79443aff 100644
--- a/src/tools/run-make-support/src/external_deps/llvm.rs
+++ b/src/tools/run-make-support/src/external_deps/llvm.rs
@@ -48,6 +48,12 @@ pub fn llvm_bcanalyzer() -> LlvmBcanalyzer {
     LlvmBcanalyzer::new()
 }
 
+/// Construct a new `llvm-dwarfdump` invocation. This assumes that `llvm-dwarfdump` is available
+/// at `$LLVM_BIN_DIR/llvm-dwarfdump`.
+pub fn llvm_dwarfdump() -> LlvmDwarfdump {
+    LlvmDwarfdump::new()
+}
+
 /// A `llvm-readobj` invocation builder.
 #[derive(Debug)]
 #[must_use]
@@ -97,6 +103,13 @@ pub struct LlvmBcanalyzer {
     cmd: Command,
 }
 
+/// A `llvm-dwarfdump` invocation builder.
+#[derive(Debug)]
+#[must_use]
+pub struct LlvmDwarfdump {
+    cmd: Command,
+}
+
 crate::macros::impl_common_helpers!(LlvmReadobj);
 crate::macros::impl_common_helpers!(LlvmProfdata);
 crate::macros::impl_common_helpers!(LlvmFilecheck);
@@ -104,6 +117,7 @@ crate::macros::impl_common_helpers!(LlvmObjdump);
 crate::macros::impl_common_helpers!(LlvmAr);
 crate::macros::impl_common_helpers!(LlvmNm);
 crate::macros::impl_common_helpers!(LlvmBcanalyzer);
+crate::macros::impl_common_helpers!(LlvmDwarfdump);
 
 /// Generate the path to the bin directory of LLVM.
 #[must_use]
@@ -317,3 +331,19 @@ impl LlvmBcanalyzer {
         self
     }
 }
+
+impl LlvmDwarfdump {
+    /// Construct a new `llvm-dwarfdump` invocation. This assumes that `llvm-dwarfdump` is available
+    /// at `$LLVM_BIN_DIR/llvm-dwarfdump`.
+    pub fn new() -> Self {
+        let llvm_dwarfdump = llvm_bin_dir().join("llvm-dwarfdump");
+        let cmd = Command::new(llvm_dwarfdump);
+        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
+    }
+}
diff --git a/src/tools/run-make-support/src/lib.rs b/src/tools/run-make-support/src/lib.rs
index a44dd00ad79..4d0c1b0930c 100644
--- a/src/tools/run-make-support/src/lib.rs
+++ b/src/tools/run-make-support/src/lib.rs
@@ -49,8 +49,9 @@ pub use c_build::{build_native_dynamic_lib, build_native_static_lib, build_nativ
 pub use clang::{clang, Clang};
 pub use htmldocck::htmldocck;
 pub use llvm::{
-    llvm_ar, llvm_bcanalyzer, llvm_filecheck, llvm_nm, llvm_objdump, llvm_profdata, llvm_readobj,
-    LlvmAr, LlvmBcanalyzer, LlvmFilecheck, LlvmNm, LlvmObjdump, LlvmProfdata, LlvmReadobj,
+    llvm_ar, llvm_bcanalyzer, llvm_dwarfdump, llvm_filecheck, llvm_nm, llvm_objdump, llvm_profdata,
+    llvm_readobj, LlvmAr, LlvmBcanalyzer, LlvmDwarfdump, LlvmFilecheck, LlvmNm, LlvmObjdump,
+    LlvmProfdata, LlvmReadobj,
 };
 pub use python::python_command;
 pub use rustc::{aux_build, bare_rustc, rustc, Rustc};
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index 14f0a9cd23d..2d25de46f6e 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -16,7 +16,6 @@ run-make/macos-deployment-target/Makefile
 run-make/min-global-align/Makefile
 run-make/native-link-modifier-bundle/Makefile
 run-make/no-alloc-shim/Makefile
-run-make/remap-path-prefix-dwarf/Makefile
 run-make/reproducible-build/Makefile
 run-make/rlib-format-packed-bundled-libs/Makefile
 run-make/split-debuginfo/Makefile