Skip to content

Commit 22fa1aa

Browse files
committed
Remove hir::AsmDialect in favour of ast::AsmDialect.
1 parent 6217b00 commit 22fa1aa

File tree

4 files changed

+6
-19
lines changed

4 files changed

+6
-19
lines changed

src/librustc_front/hir.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// The Rust HIR.
1212

13-
pub use self::AsmDialect::*;
1413
pub use self::BindingMode::*;
1514
pub use self::BinOp_::*;
1615
pub use self::BlockCheckMode::*;
@@ -41,7 +40,7 @@ pub use self::PathParameters::*;
4140

4241
use syntax::codemap::{self, Span, Spanned, DUMMY_SP, ExpnId};
4342
use syntax::abi::Abi;
44-
use syntax::ast::{Name, Ident, NodeId, DUMMY_NODE_ID, TokenTree};
43+
use syntax::ast::{Name, Ident, NodeId, DUMMY_NODE_ID, TokenTree, AsmDialect};
4544
use syntax::ast::{Attribute, Lit, StrStyle, FloatTy, IntTy, UintTy, CrateConfig};
4645
use syntax::owned_slice::OwnedSlice;
4746
use syntax::parse::token::InternedString;
@@ -876,12 +875,6 @@ pub enum Ty_ {
876875
TyInfer,
877876
}
878877

879-
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
880-
pub enum AsmDialect {
881-
AsmAtt,
882-
AsmIntel
883-
}
884-
885878
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
886879
pub struct InlineAsm {
887880
pub asm: InternedString,

src/librustc_front/lowering.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ pub fn lower_expr(e: &Expr) -> P<hir::Expr> {
801801
clobbers: clobbers.clone(),
802802
volatile: volatile,
803803
alignstack: alignstack,
804-
dialect: lower_asm_dialect(dialect),
804+
dialect: dialect,
805805
expn_id: expn_id,
806806
}),
807807
ExprStruct(ref path, ref fields, ref maybe_expr) => {
@@ -863,13 +863,6 @@ pub fn lower_capture_clause(c: CaptureClause) -> hir::CaptureClause {
863863
}
864864
}
865865

866-
pub fn lower_asm_dialect(a: AsmDialect) -> hir::AsmDialect {
867-
match a {
868-
AsmAtt => hir::AsmAtt,
869-
AsmIntel => hir::AsmIntel,
870-
}
871-
}
872-
873866
pub fn lower_visibility(v: Visibility) -> hir::Visibility {
874867
match v {
875868
Public => hir::Public,

src/librustc_front/print/pprust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,7 @@ impl<'a> State<'a> {
15391539
if a.alignstack {
15401540
options.push("alignstack");
15411541
}
1542-
if a.dialect == hir::AsmDialect::AsmIntel {
1542+
if a.dialect == ast::AsmDialect::AsmIntel {
15431543
options.push("intel");
15441544
}
15451545

src/librustc_trans/trans/asm.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use trans::type_::Type;
2222

2323
use rustc_front::hir as ast;
2424
use std::ffi::CString;
25+
use syntax::ast::AsmDialect;
2526
use libc::{c_uint, c_char};
2627

2728
// Take an inline assembly expression and splat it out via LLVM
@@ -105,8 +106,8 @@ pub fn trans_inline_asm<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, ia: &ast::InlineAsm)
105106
};
106107

107108
let dialect = match ia.dialect {
108-
ast::AsmAtt => llvm::AD_ATT,
109-
ast::AsmIntel => llvm::AD_Intel
109+
AsmDialect::AsmAtt => llvm::AD_ATT,
110+
AsmDialect::AsmIntel => llvm::AD_Intel
110111
};
111112

112113
let asm = CString::new(ia.asm.as_bytes()).unwrap();

0 commit comments

Comments
 (0)