Skip to content

Commit 18f88a4

Browse files
committed
---
yaml --- r: 6322 b: refs/heads/master c: b27a88e h: refs/heads/master v: v3
1 parent c60213e commit 18f88a4

File tree

3 files changed

+30
-13
lines changed

3 files changed

+30
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 9043bd97788bd6643c095952516670ce954a1777
2+
refs/heads/master: b27a88e99c2ab011ebc2fcaa8a8943bcfc0b3065

trunk/src/comp/middle/ast_map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ fn node_span(node: ast_node) -> codemap::span {
158158
mod test {
159159
import syntax::ast_util;
160160

161-
//FIXME NDM #[test]
161+
#[test]
162162
fn test_node_span_item() {
163163
let expected: codemap::span = ast_util::mk_sp(20u, 30u);
164164
let node =
@@ -170,7 +170,7 @@ mod test {
170170
assert (node_span(node) == expected);
171171
}
172172

173-
//FIXME NDM #[test]
173+
#[test]
174174
fn test_node_span_obj_ctor() {
175175
let expected: codemap::span = ast_util::mk_sp(20u, 30u);
176176
let node =
@@ -182,7 +182,7 @@ mod test {
182182
assert (node_span(node) == expected);
183183
}
184184

185-
//FIXME NDM #[test]
185+
#[test]
186186
fn test_node_span_native_item() {
187187
let expected: codemap::span = ast_util::mk_sp(20u, 30u);
188188
let node =
@@ -194,7 +194,7 @@ mod test {
194194
assert (node_span(node) == expected);
195195
}
196196

197-
//FIXME NDM #[test]
197+
#[test]
198198
fn test_node_span_expr() {
199199
let expected: codemap::span = ast_util::mk_sp(20u, 30u);
200200
let node = node_expr(@{id: 0, node: expr_break, span: expected});

trunk/src/comp/middle/shape.rs

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import lib::llvm::True;
55
import lib::llvm::llvm::{ModuleRef, TypeRef, ValueRef};
6+
import driver::session;
67
import middle::{trans, trans_common};
78
import middle::trans_common::{crate_ctxt, val_ty, C_bytes,
89
C_named_struct, C_struct};
@@ -231,16 +232,32 @@ fn tag_kind(ccx: @crate_ctxt, did: ast::def_id) -> tag_kind {
231232

232233

233234
// Returns the code corresponding to the pointer size on this architecture.
234-
fn s_int(_tcx: ty_ctxt) -> u8 {
235-
ret shape_i32; // TODO: x86-64
235+
fn s_int(tcx: ty_ctxt) -> u8 {
236+
ret alt tcx.sess.get_targ_cfg().arch {
237+
session::arch_x86. { shape_i32 }
238+
session::arch_x86_64. { shape_i64 }
239+
session::arch_arm. { shape_i32 }
240+
};
236241
}
237242

238-
fn s_uint(_tcx: ty_ctxt) -> u8 {
239-
ret shape_u32; // TODO: x86-64
243+
fn s_uint(tcx: ty_ctxt) -> u8 {
244+
ret alt tcx.sess.get_targ_cfg().arch {
245+
session::arch_x86. { shape_u32 }
246+
session::arch_x86_64. { shape_u64 }
247+
session::arch_arm. { shape_u32 }
248+
};
240249
}
241250

242-
fn s_float(_tcx: ty_ctxt) -> u8 {
243-
ret shape_f64; // TODO: x86-64
251+
fn s_float(tcx: ty_ctxt) -> u8 {
252+
ret alt tcx.sess.get_targ_cfg().arch {
253+
session::arch_x86. { shape_f64 }
254+
session::arch_x86_64. { shape_f64 }
255+
session::arch_arm. { shape_f64 }
256+
};
257+
}
258+
259+
fn s_variant_tag_t(tcx: ty_ctxt) -> u8 {
260+
ret s_int(tcx);
244261
}
245262

246263
fn mk_ctxt(llmod: ModuleRef) -> ctxt {
@@ -329,9 +346,9 @@ fn shape_of(ccx: @crate_ctxt, t: ty::t, ty_param_map: [uint],
329346
alt tag_kind(ccx, did) {
330347
tk_unit. {
331348
// FIXME: For now we do this.
332-
s += [shape_u32];
349+
s += [s_variant_tag_t(ccx.tcx)];
333350
}
334-
tk_enum. { s += [shape_u32]; }
351+
tk_enum. { s += [s_variant_tag_t(ccx.tcx)]; }
335352
tk_complex. {
336353
s += [shape_tag];
337354

0 commit comments

Comments
 (0)