Skip to content

Commit

Permalink
Remove hir::AsmDialect in favour of ast::AsmDialect.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed Sep 21, 2015
1 parent 6217b00 commit 22fa1aa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 19 deletions.
9 changes: 1 addition & 8 deletions src/librustc_front/hir.rs
Expand Up @@ -10,7 +10,6 @@

// The Rust HIR.

pub use self::AsmDialect::*;
pub use self::BindingMode::*;
pub use self::BinOp_::*;
pub use self::BlockCheckMode::*;
Expand Down Expand Up @@ -41,7 +40,7 @@ pub use self::PathParameters::*;

use syntax::codemap::{self, Span, Spanned, DUMMY_SP, ExpnId};
use syntax::abi::Abi;
use syntax::ast::{Name, Ident, NodeId, DUMMY_NODE_ID, TokenTree};
use syntax::ast::{Name, Ident, NodeId, DUMMY_NODE_ID, TokenTree, AsmDialect};
use syntax::ast::{Attribute, Lit, StrStyle, FloatTy, IntTy, UintTy, CrateConfig};
use syntax::owned_slice::OwnedSlice;
use syntax::parse::token::InternedString;
Expand Down Expand Up @@ -876,12 +875,6 @@ pub enum Ty_ {
TyInfer,
}

#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
pub enum AsmDialect {
AsmAtt,
AsmIntel
}

#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
pub struct InlineAsm {
pub asm: InternedString,
Expand Down
9 changes: 1 addition & 8 deletions src/librustc_front/lowering.rs
Expand Up @@ -801,7 +801,7 @@ pub fn lower_expr(e: &Expr) -> P<hir::Expr> {
clobbers: clobbers.clone(),
volatile: volatile,
alignstack: alignstack,
dialect: lower_asm_dialect(dialect),
dialect: dialect,
expn_id: expn_id,
}),
ExprStruct(ref path, ref fields, ref maybe_expr) => {
Expand Down Expand Up @@ -863,13 +863,6 @@ pub fn lower_capture_clause(c: CaptureClause) -> hir::CaptureClause {
}
}

pub fn lower_asm_dialect(a: AsmDialect) -> hir::AsmDialect {
match a {
AsmAtt => hir::AsmAtt,
AsmIntel => hir::AsmIntel,
}
}

pub fn lower_visibility(v: Visibility) -> hir::Visibility {
match v {
Public => hir::Public,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_front/print/pprust.rs
Expand Up @@ -1539,7 +1539,7 @@ impl<'a> State<'a> {
if a.alignstack {
options.push("alignstack");
}
if a.dialect == hir::AsmDialect::AsmIntel {
if a.dialect == ast::AsmDialect::AsmIntel {
options.push("intel");
}

Expand Down
5 changes: 3 additions & 2 deletions src/librustc_trans/trans/asm.rs
Expand Up @@ -22,6 +22,7 @@ use trans::type_::Type;

use rustc_front::hir as ast;
use std::ffi::CString;
use syntax::ast::AsmDialect;
use libc::{c_uint, c_char};

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

let dialect = match ia.dialect {
ast::AsmAtt => llvm::AD_ATT,
ast::AsmIntel => llvm::AD_Intel
AsmDialect::AsmAtt => llvm::AD_ATT,
AsmDialect::AsmIntel => llvm::AD_Intel
};

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

0 comments on commit 22fa1aa

Please sign in to comment.