@@ -60,6 +60,12 @@ pub fn llvm_pdbutil() -> LlvmPdbutil {
60
60
LlvmPdbutil :: new ( )
61
61
}
62
62
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
+
63
69
/// Construct a new `llvm-dis` invocation. This assumes that `llvm-dis` is available
64
70
/// at `$LLVM_BIN_DIR/llvm-dis`.
65
71
pub fn llvm_dis ( ) -> LlvmDis {
@@ -135,6 +141,13 @@ pub struct LlvmPdbutil {
135
141
cmd : Command ,
136
142
}
137
143
144
+ /// A `llvm-as` invocation builder.
145
+ #[ derive( Debug ) ]
146
+ #[ must_use]
147
+ pub struct LlvmAs {
148
+ cmd : Command ,
149
+ }
150
+
138
151
/// A `llvm-dis` invocation builder.
139
152
#[ derive( Debug ) ]
140
153
#[ must_use]
@@ -158,6 +171,7 @@ crate::macros::impl_common_helpers!(LlvmNm);
158
171
crate :: macros:: impl_common_helpers!( LlvmBcanalyzer ) ;
159
172
crate :: macros:: impl_common_helpers!( LlvmDwarfdump ) ;
160
173
crate :: macros:: impl_common_helpers!( LlvmPdbutil ) ;
174
+ crate :: macros:: impl_common_helpers!( LlvmAs ) ;
161
175
crate :: macros:: impl_common_helpers!( LlvmDis ) ;
162
176
crate :: macros:: impl_common_helpers!( LlvmObjcopy ) ;
163
177
@@ -441,6 +455,22 @@ impl LlvmObjcopy {
441
455
}
442
456
}
443
457
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
+
444
474
impl LlvmDis {
445
475
/// Construct a new `llvm-dis` invocation. This assumes that `llvm-dis` is available
446
476
/// at `$LLVM_BIN_DIR/llvm-dis`.
0 commit comments