Skip to content

Commit 1861a10

Browse files
committed
---
yaml --- r: 139413 b: refs/heads/try2 c: b867fe4 h: refs/heads/master i: 139411: e07ef7c v: v3
1 parent 04605f9 commit 1861a10

File tree

5 files changed

+23
-8
lines changed

5 files changed

+23
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 203d691a6bf6795f3d1f77378696a4506dd550f2
8+
refs/heads/try2: b867fe41defd95d839c96e2b746d1c7560fd338f
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/trans/asm.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,15 @@ pub fn trans_inline_asm(bcx: block, ia: &ast::inline_asm) -> block {
104104
T_struct(outputs.map(|o| val_ty(*o)))
105105
};
106106

107+
let dialect = match ia.dialect {
108+
ast::asm_att => lib::llvm::AD_ATT,
109+
ast::asm_intel => lib::llvm::AD_Intel
110+
};
111+
107112
let r = do str::as_c_str(*ia.asm) |a| {
108113
do str::as_c_str(constraints) |c| {
109114
// XXX: Allow selection of at&t or intel
110-
InlineAsmCall(bcx, a, c, inputs, output, ia.volatile, ia.alignstack, lib::llvm::AD_ATT)
115+
InlineAsmCall(bcx, a, c, inputs, output, ia.volatile, ia.alignstack, dialect)
111116
}
112117
};
113118

branches/try2/src/libsyntax/ast.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,14 @@ impl to_bytes::IterBytes for Ty {
934934
}
935935
}
936936
937+
#[auto_encode]
938+
#[auto_decode]
939+
#[deriving(Eq)]
940+
pub enum asm_dialect {
941+
asm_att,
942+
asm_intel
943+
}
944+
937945
#[auto_encode]
938946
#[auto_decode]
939947
#[deriving(Eq)]
@@ -943,7 +951,8 @@ pub struct inline_asm {
943951
inputs: ~[(@~str, @expr)],
944952
outputs: ~[(@~str, @expr)],
945953
volatile: bool,
946-
alignstack: bool
954+
alignstack: bool,
955+
dialect: asm_dialect
947956
}
948957
949958
#[auto_encode]

branches/try2/src/libsyntax/ext/asm.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ pub fn expand_asm(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
5353
let mut cons = ~"";
5454
let mut volatile = false;
5555
let mut alignstack = false;
56+
let mut dialect = ast::asm_att;
5657

5758
let mut state = Asm;
5859
loop outer: {
@@ -125,6 +126,8 @@ pub fn expand_asm(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
125126
volatile = true;
126127
} else if option == ~"alignstack" {
127128
alignstack = true;
129+
} else if option == ~"intel" {
130+
dialect = ast::asm_intel;
128131
}
129132

130133
if *p.token == token::COMMA {
@@ -169,7 +172,8 @@ pub fn expand_asm(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
169172
inputs: inputs,
170173
outputs: outputs,
171174
volatile: volatile,
172-
alignstack: alignstack
175+
alignstack: alignstack,
176+
dialect: dialect
173177
}),
174178
span: sp
175179
})

branches/try2/src/libsyntax/fold.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -561,12 +561,9 @@ pub fn noop_fold_expr(e: &expr_, fld: @ast_fold) -> expr_ {
561561
}
562562
expr_inline_asm(a) => {
563563
expr_inline_asm(inline_asm {
564-
asm: a.asm,
565-
clobbers: a.clobbers,
566564
inputs: a.inputs.map(|&(c, in)| (c, fld.fold_expr(in))),
567565
outputs: a.outputs.map(|&(c, out)| (c, fld.fold_expr(out))),
568-
volatile: a.volatile,
569-
alignstack: a.alignstack
566+
.. a
570567
})
571568
}
572569
expr_mac(ref mac) => expr_mac(fold_mac((*mac))),

0 commit comments

Comments
 (0)