Skip to content

Commit 1f2f8b1

Browse files
committed
---
yaml --- r: 1274 b: refs/heads/master c: 2c27feb h: refs/heads/master v: v3
1 parent d7be25e commit 1f2f8b1

File tree

2 files changed

+36
-28
lines changed

2 files changed

+36
-28
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: 45fd05ac4293e9cb9bbcf0ec89539f54d0de6059
2+
refs/heads/master: 2c27feb76a4754faee6e997339826c6f2afc1432

trunk/src/comp/middle/trans.rs

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,8 @@ fn sanitize(str s) -> str {
482482
result += "_of_";
483483
} else {
484484
if (c != 10u8 && c != ('}' as u8) && c != (')' as u8) &&
485-
c != (' ' as u8) && c != ('\t' as u8) &&
486-
c != (';' as u8)) {
485+
c != (' ' as u8) && c != ('\t' as u8) &&
486+
c != (';' as u8)) {
487487
auto v = vec(c);
488488
result += _str.from_bytes(v);
489489
}
@@ -977,15 +977,17 @@ fn incr_refcnt_of_boxed(@block_ctxt cx, ValueRef box_ptr) -> result {
977977
fn make_drop_glue(@block_ctxt cx, ValueRef v, @ty.t t) -> result {
978978
alt (t.struct) {
979979
case (ty.ty_str) {
980-
ret decr_refcnt_and_if_zero(cx, v,
981-
bind trans_non_gc_free(_, v),
982-
"free string",
983-
T_int(), C_int(0));
980+
ret decr_refcnt_and_if_zero
981+
(cx, v, bind trans_non_gc_free(_, v),
982+
"free string",
983+
T_int(), C_int(0));
984984
}
985985

986986
case (ty.ty_vec(_)) {
987-
fn hit_zero(@block_ctxt cx, ValueRef v, @ty.t t) -> result {
988-
auto res = iter_sequence(cx, v, t, bind drop_ty(_,_,_));
987+
fn hit_zero(@block_ctxt cx, ValueRef v,
988+
@ty.t t) -> result {
989+
auto res = iter_sequence(cx, v, t,
990+
bind drop_ty(_,_,_));
989991
// FIXME: switch gc/non-gc on layer of the type.
990992
ret trans_non_gc_free(res.bcx, v);
991993
}
@@ -996,7 +998,8 @@ fn make_drop_glue(@block_ctxt cx, ValueRef v, @ty.t t) -> result {
996998
}
997999

9981000
case (ty.ty_box(?body_ty)) {
999-
fn hit_zero(@block_ctxt cx, ValueRef v, @ty.t body_ty) -> result {
1001+
fn hit_zero(@block_ctxt cx, ValueRef v,
1002+
@ty.t body_ty) -> result {
10001003
auto body = cx.build.GEP(v,
10011004
vec(C_int(0),
10021005
C_int(abi.box_rc_field_body)));
@@ -1274,11 +1277,14 @@ fn iter_structural_ty(@block_ctxt cx,
12741277

12751278
auto j = 0u;
12761279
for (ty.arg a in args) {
1277-
auto llfldp = variant_cx.build.GEP(llvarp,
1278-
vec(C_int(0), C_int(j as int)));
1280+
auto v = vec(C_int(0),
1281+
C_int(j as int));
1282+
auto llfldp =
1283+
variant_cx.build.GEP(llvarp, v);
1284+
12791285
auto llfld =
12801286
load_scalar_or_boxed(variant_cx,
1281-
llfldp, a.ty);
1287+
llfldp, a.ty);
12821288

12831289
auto res = f(variant_cx, llfld, a.ty);
12841290
variant_cx = res.bcx;
@@ -1830,7 +1836,7 @@ impure fn trans_do_while(@block_ctxt cx, &ast.block body,
18301836
// Returns a pointer to the union part of the LLVM representation of a tag
18311837
// type, cast to the appropriate type.
18321838
fn get_pat_union_ptr(@block_ctxt cx, vec[@ast.pat] subpats, ValueRef llval)
1833-
-> ValueRef {
1839+
-> ValueRef {
18341840
auto llblobptr = cx.build.GEP(llval, vec(C_int(0), C_int(1)));
18351841

18361842
// Generate the union type.
@@ -1861,7 +1867,7 @@ impure fn trans_pat_match(@block_ctxt cx, @ast.pat pat, ValueRef llval,
18611867
for (tup(ast.def_id,arity) vinfo in tinfo.variants) {
18621868
auto this_variant_id = vinfo._0;
18631869
if (variant_id._0 == this_variant_id._0 &&
1864-
variant_id._1 == this_variant_id._1) {
1870+
variant_id._1 == this_variant_id._1) {
18651871
variant_tag = i;
18661872
}
18671873
i += 1;
@@ -1882,8 +1888,8 @@ impure fn trans_pat_match(@block_ctxt cx, @ast.pat pat, ValueRef llval,
18821888
vec(C_int(0),
18831889
C_int(i)));
18841890
auto llsubval = load_scalar_or_boxed(matched_cx,
1885-
llsubvalptr,
1886-
pat_ty(subpat));
1891+
llsubvalptr,
1892+
pat_ty(subpat));
18871893
auto subpat_res = trans_pat_match(matched_cx, subpat,
18881894
llsubval, next_cx);
18891895
matched_cx = subpat_res.bcx;
@@ -1923,7 +1929,7 @@ impure fn trans_pat_binding(@block_ctxt cx, @ast.pat pat, ValueRef llval)
19231929
auto llsubvalptr = this_cx.build.GEP(llunionptr,
19241930
vec(C_int(0), C_int(i)));
19251931
auto llsubval = load_scalar_or_boxed(this_cx, llsubvalptr,
1926-
pat_ty(subpat));
1932+
pat_ty(subpat));
19271933
auto subpat_res = trans_pat_binding(this_cx, subpat,
19281934
llsubval);
19291935
this_cx = subpat_res.bcx;
@@ -1993,7 +1999,7 @@ fn lval_val(@block_ctxt cx, ValueRef val) -> lval_result {
19931999
}
19942000

19952001
fn trans_path(@block_ctxt cx, &ast.path p, &option.t[ast.def] dopt,
1996-
&ast.ann ann) -> lval_result {
2002+
&ast.ann ann) -> lval_result {
19972003
alt (dopt) {
19982004
case (some[ast.def](?def)) {
19992005
alt (def) {
@@ -2493,11 +2499,11 @@ impure fn trans_call(@block_ctxt cx, @ast.expr f,
24932499
auto bcx = f_res.res.bcx;
24942500
auto pair = faddr;
24952501
faddr = bcx.build.GEP(pair, vec(C_int(0),
2496-
C_int(abi.fn_field_code)));
2502+
C_int(abi.fn_field_code)));
24972503
faddr = bcx.build.Load(faddr);
24982504

24992505
llclosure = bcx.build.GEP(pair, vec(C_int(0),
2500-
C_int(abi.fn_field_box)));
2506+
C_int(abi.fn_field_box)));
25012507
llclosure = bcx.build.Load(llclosure);
25022508
}
25032509
}
@@ -2680,7 +2686,7 @@ impure fn trans_expr(@block_ctxt cx, @ast.expr e) -> result {
26802686
auto lhs_res = trans_lval(cx, dst);
26812687
check (lhs_res.is_mem);
26822688
auto lhs_val = load_scalar_or_boxed(lhs_res.res.bcx,
2683-
lhs_res.res.val, t);
2689+
lhs_res.res.val, t);
26842690
auto rhs_res = trans_expr(lhs_res.res.bcx, src);
26852691
auto v = trans_eager_binop(rhs_res.bcx, op, lhs_val, rhs_res.val);
26862692
// FIXME: calculate copy init-ness in typestate.
@@ -3609,10 +3615,12 @@ fn resolve_tag_types_for_item(&@crate_ctxt cx, @ast.item i) -> @crate_ctxt {
36093615
auto arity_info;
36103616
if (_vec.len[ast.variant_arg](variant.args) > 0u) {
36113617
auto llvariantty = type_of_variant(cx, variant);
3612-
auto align = llvm.LLVMPreferredAlignmentOfType(cx.td.lltd,
3613-
llvariantty);
3614-
auto size = llvm.LLVMStoreSizeOfType(cx.td.lltd,
3615-
llvariantty) as uint;
3618+
auto align =
3619+
llvm.LLVMPreferredAlignmentOfType(cx.td.lltd,
3620+
llvariantty);
3621+
auto size =
3622+
llvm.LLVMStoreSizeOfType(cx.td.lltd,
3623+
llvariantty) as uint;
36163624
if (max_align < align) { max_align = align; }
36173625
if (max_size < size) { max_size = size; }
36183626

@@ -3957,8 +3965,8 @@ fn make_glues(ModuleRef llmod) -> @glue_fns {
39573965
T_fn(vec(T_taskptr()), T_void())),
39583966

39593967
upcall_glues =
3960-
_vec.init_fn[ValueRef](bind decl_upcall(llmod, _),
3961-
abi.n_upcall_glues as uint),
3968+
_vec.init_fn[ValueRef](bind decl_upcall(llmod, _),
3969+
abi.n_upcall_glues as uint),
39623970
no_op_type_glue = make_no_op_type_glue(llmod),
39633971
memcpy_glue = make_memcpy_glue(llmod),
39643972
bzero_glue = make_bzero_glue(llmod));

0 commit comments

Comments
 (0)