@@ -60,6 +60,12 @@ pub fn llvm_pdbutil() -> LlvmPdbutil {
6060 LlvmPdbutil :: new ( )
6161}
6262
63+ /// Construct a new `llvm-as` invocation. This assumes that `llvm-as` is available
64+ /// at `$LLVM_BIN_DIR/llvm-as`.
65+ pub fn llvm_as ( ) -> LlvmAs {
66+ LlvmAs :: new ( )
67+ }
68+
6369/// Construct a new `llvm-dis` invocation. This assumes that `llvm-dis` is available
6470/// at `$LLVM_BIN_DIR/llvm-dis`.
6571pub fn llvm_dis ( ) -> LlvmDis {
@@ -135,6 +141,13 @@ pub struct LlvmPdbutil {
135141 cmd : Command ,
136142}
137143
144+ /// A `llvm-as` invocation builder.
145+ #[ derive( Debug ) ]
146+ #[ must_use]
147+ pub struct LlvmAs {
148+ cmd : Command ,
149+ }
150+
138151/// A `llvm-dis` invocation builder.
139152#[ derive( Debug ) ]
140153#[ must_use]
@@ -158,6 +171,7 @@ crate::macros::impl_common_helpers!(LlvmNm);
158171crate :: macros:: impl_common_helpers!( LlvmBcanalyzer ) ;
159172crate :: macros:: impl_common_helpers!( LlvmDwarfdump ) ;
160173crate :: macros:: impl_common_helpers!( LlvmPdbutil ) ;
174+ crate :: macros:: impl_common_helpers!( LlvmAs ) ;
161175crate :: macros:: impl_common_helpers!( LlvmDis ) ;
162176crate :: macros:: impl_common_helpers!( LlvmObjcopy ) ;
163177
@@ -441,6 +455,22 @@ impl LlvmObjcopy {
441455 }
442456}
443457
458+ impl LlvmAs {
459+ /// Construct a new `llvm-as` invocation. This assumes that `llvm-as` is available
460+ /// at `$LLVM_BIN_DIR/llvm-as`.
461+ pub fn new ( ) -> Self {
462+ let llvm_as = llvm_bin_dir ( ) . join ( "llvm-as" ) ;
463+ let cmd = Command :: new ( llvm_as) ;
464+ Self { cmd }
465+ }
466+
467+ /// Provide an input file.
468+ pub fn input < P : AsRef < Path > > ( & mut self , path : P ) -> & mut Self {
469+ self . cmd . arg ( path. as_ref ( ) ) ;
470+ self
471+ }
472+ }
473+
444474impl LlvmDis {
445475 /// Construct a new `llvm-dis` invocation. This assumes that `llvm-dis` is available
446476 /// at `$LLVM_BIN_DIR/llvm-dis`.
0 commit comments