Skip to content

Commit f61238f

Browse files
committed
---
yaml --- r: 49103 b: refs/heads/snap-stage3 c: b867fe4 h: refs/heads/master i: 49101: e2677f1 49099: 9678001 49095: 42c993d 49087: b573e96 v: v3
1 parent 62161ae commit f61238f

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 3bbcac322669cff3abde5be937cc4ec3860f3985
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 203d691a6bf6795f3d1f77378696a4506dd550f2
4+
refs/heads/snap-stage3: b867fe41defd95d839c96e2b746d1c7560fd338f
55
refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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/snap-stage3/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/snap-stage3/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/snap-stage3/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)