Skip to content

Commit 2aeeb93

Browse files
committed
---
yaml --- r: 1975 b: refs/heads/master c: 3971110 h: refs/heads/master i: 1973: 10fa0cb 1971: fe32194 1967: 0a27f31 v: v3
1 parent 8cc1117 commit 2aeeb93

File tree

2 files changed

+57
-57
lines changed

2 files changed

+57
-57
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 7d88e63ec8b93fdc5929e83933bc2ce5a58cbfa9
2+
refs/heads/master: 3971110d7f60f315e7ef0c3a7f9feb8af6e5ed08

trunk/src/comp/middle/trans.rs

+56-56
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ fn sep() -> str {
161161
}
162162

163163
fn extend_path(@crate_ctxt cx, str name) -> @crate_ctxt {
164-
ret @rec(path = cx.path + vec(name) with *cx);
164+
ret @rec(path = cx.path + vec(name) with *cx);
165165
}
166166

167167
fn path_name(vec[str] path) -> str {
@@ -529,7 +529,7 @@ fn type_of(@crate_ctxt cx, @ty.t t) -> TypeRef {
529529
}
530530

531531
fn type_of_explicit_args(@crate_ctxt cx,
532-
vec[ty.arg] inputs) -> vec[TypeRef] {
532+
vec[ty.arg] inputs) -> vec[TypeRef] {
533533
let vec[TypeRef] atys = vec();
534534
for (ty.arg arg in inputs) {
535535
if (ty.type_has_dynamic_size(arg.ty)) {
@@ -765,7 +765,7 @@ fn type_of_arg(@crate_ctxt cx, &ty.arg arg) -> TypeRef {
765765
}
766766

767767
fn type_of_ty_params_opt_and_ty(@crate_ctxt ccx, ty.ty_params_opt_and_ty tpt)
768-
-> TypeRef {
768+
-> TypeRef {
769769
alt (tpt._1.struct) {
770770
case (ty.ty_fn(?proto, ?inputs, ?output)) {
771771
auto ty_params = option.get[vec[ast.def_id]](tpt._0);
@@ -914,7 +914,7 @@ fn decl_fastcall_fn(ModuleRef llmod, str name, TypeRef llty) -> ValueRef {
914914
}
915915

916916
fn decl_internal_fastcall_fn(ModuleRef llmod,
917-
str name, TypeRef llty) -> ValueRef {
917+
str name, TypeRef llty) -> ValueRef {
918918
auto llfn = decl_fn(llmod, name, lib.llvm.LLVMFastCallConv, llty);
919919
llvm.LLVMSetLinkage(llfn, lib.llvm.LLVMInternalLinkage as llvm.Linkage);
920920
ret llfn;
@@ -963,7 +963,7 @@ fn get_extern_const(&hashmap[str, ValueRef] externs,
963963
}
964964

965965
fn get_simple_extern_fn(&hashmap[str, ValueRef] externs,
966-
ModuleRef llmod, str name, int n_args) -> ValueRef {
966+
ModuleRef llmod, str name, int n_args) -> ValueRef {
967967
auto inputs = _vec.init_elt[TypeRef](T_int(), n_args as uint);
968968
auto output = T_int();
969969
auto t = T_fn(inputs, output);
@@ -1361,7 +1361,7 @@ fn GEP_tag(@block_ctxt cx,
13611361
&ast.def_id variant_id,
13621362
vec[@ty.t] ty_substs,
13631363
int ix)
1364-
-> result {
1364+
-> result {
13651365
auto ty_params = tag_ty_params(cx.fcx.ccx, tag_id);
13661366
auto variant = tag_variant_with_id(cx.fcx.ccx, tag_id, variant_id);
13671367

@@ -1410,7 +1410,7 @@ fn GEP_tag(@block_ctxt cx,
14101410

14111411

14121412
fn trans_raw_malloc(@block_ctxt cx, TypeRef llptr_ty, ValueRef llsize)
1413-
-> result {
1413+
-> result {
14141414
// FIXME: need a table to collect tydesc globals.
14151415
auto tydesc = C_int(0);
14161416
auto rslt = trans_upcall(cx, "upcall_malloc", vec(llsize, tydesc));
@@ -1600,10 +1600,10 @@ fn declare_tydesc(@crate_ctxt cx, @ty.t t) {
16001600
as llvm.Linkage);
16011601

16021602
auto info = rec(
1603-
tydesc=gvar,
1604-
take_glue=take_glue,
1605-
drop_glue=drop_glue
1606-
);
1603+
tydesc=gvar,
1604+
take_glue=take_glue,
1605+
drop_glue=drop_glue
1606+
);
16071607

16081608
cx.tydescs.insert(t, @info);
16091609
}
@@ -2098,17 +2098,17 @@ fn iter_structural_ty_full(@block_ctxt cx,
20982098
auto v = vec(C_int(0), C_int(j as int));
20992099

21002100
auto rslt = GEP_tag(variant_cx, llunion_a_ptr,
2101-
tid, variant.id, tps, j);
2101+
tid, variant.id, tps, j);
21022102
auto llfldp_a = rslt.val;
21032103
variant_cx = rslt.bcx;
21042104

21052105
rslt = GEP_tag(variant_cx, llunion_b_ptr, tid,
2106-
variant.id, tps, j);
2106+
variant.id, tps, j);
21072107
auto llfldp_b = rslt.val;
21082108
variant_cx = rslt.bcx;
21092109

21102110
auto ty_subst = ty.substitute_ty_params(
2111-
ty_params, tps, a.ty);
2111+
ty_params, tps, a.ty);
21122112

21132113
auto llfld_a =
21142114
load_scalar_or_boxed(variant_cx,
@@ -2330,8 +2330,8 @@ fn call_tydesc_glue(@block_ctxt cx, ValueRef v, @ty.t t, int field) {
23302330
}
23312331

23322332
fn take_ty(@block_ctxt cx,
2333-
ValueRef v,
2334-
@ty.t t) -> result {
2333+
ValueRef v,
2334+
@ty.t t) -> result {
23352335
if (!ty.type_is_scalar(t)) {
23362336
call_tydesc_glue(cx, v, t, abi.tydesc_field_take_glue_off);
23372337
}
@@ -3163,11 +3163,11 @@ fn trans_for(@block_ctxt cx,
31633163
// Searches through a block for all references to locals or upvars in this
31643164
// frame and returns the list of definition IDs thus found.
31653165
fn collect_upvars(@block_ctxt cx, &ast.block bloc, &ast.def_id initial_decl)
3166-
-> vec[ast.def_id] {
3166+
-> vec[ast.def_id] {
31673167
type env = @rec(
3168-
mutable vec[ast.def_id] refs,
3169-
hashmap[ast.def_id,()] decls
3170-
);
3168+
mutable vec[ast.def_id] refs,
3169+
hashmap[ast.def_id,()] decls
3170+
);
31713171

31723172
fn fold_expr_path(&env e, &common.span sp, &ast.path p,
31733173
&option.t[ast.def] d, ast.ann a) -> @ast.expr {
@@ -3182,18 +3182,18 @@ fn collect_upvars(@block_ctxt cx, &ast.block bloc, &ast.def_id initial_decl)
31823182
}
31833183

31843184
fn fold_decl_local(&env e, &common.span sp, @ast.local local)
3185-
-> @ast.decl {
3185+
-> @ast.decl {
31863186
e.decls.insert(local.id, ());
31873187
ret @fold.respan[ast.decl_](sp, ast.decl_local(local));
31883188
}
31893189

31903190
auto fep = fold_expr_path;
31913191
auto fdl = fold_decl_local;
31923192
auto fld = @rec(
3193-
fold_expr_path=fep,
3194-
fold_decl_local=fdl
3195-
with *fold.new_identity_fold[env]()
3196-
);
3193+
fold_expr_path=fep,
3194+
fold_decl_local=fdl
3195+
with *fold.new_identity_fold[env]()
3196+
);
31973197

31983198
let vec[ast.def_id] refs = vec();
31993199
let hashmap[ast.def_id,()] decls = new_def_hash[()]();
@@ -3320,7 +3320,7 @@ fn trans_for_each(@block_ctxt cx,
33203320
plain_ty(ty.ty_nil), 0u);
33213321

33223322
let ValueRef lliterbody = decl_internal_fastcall_fn(cx.fcx.ccx.llmod,
3323-
s, iter_body_llty);
3323+
s, iter_body_llty);
33243324

33253325
// FIXME: handle ty params properly.
33263326
let vec[ast.ty_param] ty_params = vec();
@@ -3332,7 +3332,7 @@ fn trans_for_each(@block_ctxt cx,
33323332
// Populate the upvars from the environment.
33333333
auto llremoteenvptr = bcx.build.PointerCast(fcx.llenv, llenvptrty);
33343334
auto llremotebindingsptrptr = bcx.build.GEP(llremoteenvptr,
3335-
vec(C_int(0), C_int(abi.box_rc_field_body), C_int(2)));
3335+
vec(C_int(0), C_int(abi.box_rc_field_body), C_int(2)));
33363336
auto llremotebindingsptr = bcx.build.Load(llremotebindingsptrptr);
33373337

33383338
auto i = 0u;
@@ -3377,7 +3377,7 @@ fn trans_for_each(@block_ctxt cx,
33773377
auto env_cell = cx.build.GEP(pair, vec(C_int(0),
33783378
C_int(abi.fn_field_box)));
33793379
auto llenvblobptr = cx.build.PointerCast(llenvptr,
3380-
T_opaque_closure_ptr(cx.fcx.ccx.tn));
3380+
T_opaque_closure_ptr(cx.fcx.ccx.tn));
33813381
cx.build.Store(llenvblobptr, env_cell);
33823382

33833383
// log "lliterbody: " + val_str(cx.fcx.ccx.tn, lliterbody);
@@ -3448,7 +3448,7 @@ fn trans_pat_match(@block_ctxt cx, @ast.pat pat, ValueRef llval,
34483448

34493449
case (ast.pat_tag(?id, ?subpats, ?vdef_opt, ?ann)) {
34503450
auto lltagptr = cx.build.PointerCast(llval,
3451-
T_opaque_tag_ptr(cx.fcx.ccx.tn));
3451+
T_opaque_tag_ptr(cx.fcx.ccx.tn));
34523452

34533453
auto lldiscrimptr = cx.build.GEP(lltagptr,
34543454
vec(C_int(0), C_int(0)));
@@ -3479,7 +3479,7 @@ fn trans_pat_match(@block_ctxt cx, @ast.pat pat, ValueRef llval,
34793479

34803480
if (_vec.len[@ast.pat](subpats) > 0u) {
34813481
auto llblobptr = matched_cx.build.GEP(lltagptr,
3482-
vec(C_int(0), C_int(1)));
3482+
vec(C_int(0), C_int(1)));
34833483
auto i = 0;
34843484
for (@ast.pat subpat in subpats) {
34853485
auto rslt = GEP_tag(matched_cx, llblobptr, vdef._0,
@@ -3529,7 +3529,7 @@ fn trans_pat_binding(@block_ctxt cx, @ast.pat pat, ValueRef llval)
35293529
auto vdef = option.get[ast.variant_def](vdef_opt);
35303530

35313531
auto lltagptr = cx.build.PointerCast(llval,
3532-
T_opaque_tag_ptr(cx.fcx.ccx.tn));
3532+
T_opaque_tag_ptr(cx.fcx.ccx.tn));
35333533
auto llblobptr = cx.build.GEP(lltagptr, vec(C_int(0), C_int(1)));
35343534

35353535
auto ty_param_substs = node_ann_ty_params(ann);
@@ -3625,7 +3625,7 @@ fn lval_generic_fn(@block_ctxt cx,
36253625
ty.ty_params_and_ty tpt,
36263626
ast.def_id fn_id,
36273627
&ast.ann ann)
3628-
-> lval_result {
3628+
-> lval_result {
36293629
auto lv;
36303630
if (cx.fcx.ccx.sess.get_targ_crate_num() == fn_id._0) {
36313631
// Internal reference.
@@ -3704,12 +3704,12 @@ fn trans_path(@block_ctxt cx, &ast.path p, &option.t[ast.def] dopt,
37043704
}
37053705
case (ast.def_fn(?did)) {
37063706
auto tyt = ty.lookup_generic_item_type(cx.fcx.ccx.sess,
3707-
cx.fcx.ccx.type_cache, did);
3707+
cx.fcx.ccx.type_cache, did);
37083708
ret lval_generic_fn(cx, tyt, did, ann);
37093709
}
37103710
case (ast.def_obj(?did)) {
37113711
auto tyt = ty.lookup_generic_item_type(cx.fcx.ccx.sess,
3712-
cx.fcx.ccx.type_cache, did);
3712+
cx.fcx.ccx.type_cache, did);
37133713
ret lval_generic_fn(cx, tyt, did, ann);
37143714
}
37153715
case (ast.def_variant(?tid, ?vid)) {
@@ -3746,10 +3746,10 @@ fn trans_path(@block_ctxt cx, &ast.path p, &option.t[ast.def] dopt,
37463746
lltagty = type_of(cx.fcx.ccx, tag_ty);
37473747
}
37483748
auto lltagptr = alloc_result.bcx.build.PointerCast(
3749-
lltagblob, T_ptr(lltagty));
3749+
lltagblob, T_ptr(lltagty));
37503750

37513751
auto lldiscrimptr = alloc_result.bcx.build.GEP(
3752-
lltagptr, vec(C_int(0), C_int(0)));
3752+
lltagptr, vec(C_int(0), C_int(0)));
37533753
alloc_result.bcx.build.Store(lldiscrim, lldiscrimptr);
37543754

37553755
ret lval_val(alloc_result.bcx, lltagptr);
@@ -3762,7 +3762,7 @@ fn trans_path(@block_ctxt cx, &ast.path p, &option.t[ast.def] dopt,
37623762
}
37633763
case (ast.def_native_fn(?did)) {
37643764
auto tyt = ty.lookup_generic_item_type(cx.fcx.ccx.sess,
3765-
cx.fcx.ccx.type_cache, did);
3765+
cx.fcx.ccx.type_cache, did);
37663766
ret lval_generic_fn(cx, tyt, did, ann);
37673767
}
37683768
case (_) {
@@ -3898,7 +3898,7 @@ fn trans_cast(@block_ctxt cx, @ast.expr e, &ast.ann ann) -> result {
38983898
} else if (ty.type_is_native(t)) {
38993899
e_res.val = e_res.bcx.build.IntToPtr(e_res.val, lldsttype);
39003900
} else if (llvm.LLVMGetIntTypeWidth(lldsttype) >
3901-
llvm.LLVMGetIntTypeWidth(llsrctype)) {
3901+
llvm.LLVMGetIntTypeWidth(llsrctype)) {
39023902
if (ty.type_is_signed(t)) {
39033903
// Widening signed cast.
39043904
e_res.val =
@@ -4435,11 +4435,11 @@ fn trans_call(@block_ctxt cx, @ast.expr f,
44354435
auto llretslot = args_res._2;
44364436

44374437
/*
4438-
log "calling: " + val_str(cx.fcx.ccx.tn, faddr);
4438+
log "calling: " + val_str(cx.fcx.ccx.tn, faddr);
44394439
4440-
for (ValueRef arg in llargs) {
4441-
log "arg: " + val_str(cx.fcx.ccx.tn, arg);
4442-
}
4440+
for (ValueRef arg in llargs) {
4441+
log "arg: " + val_str(cx.fcx.ccx.tn, arg);
4442+
}
44434443
*/
44444444

44454445
bcx.build.FastCall(faddr, llargs);
@@ -4499,11 +4499,11 @@ fn trans_call_self(@block_ctxt cx, @ast.expr f,
44994499
auto llretslot = args_res._2;
45004500

45014501
/*
4502-
log "calling: " + val_str(cx.fcx.ccx.tn, faddr);
4502+
log "calling: " + val_str(cx.fcx.ccx.tn, faddr);
45034503
4504-
for (ValueRef arg in llargs) {
4505-
log "arg: " + val_str(cx.fcx.ccx.tn, arg);
4506-
}
4504+
for (ValueRef arg in llargs) {
4505+
log "arg: " + val_str(cx.fcx.ccx.tn, arg);
4506+
}
45074507
*/
45084508

45094509
bcx.build.FastCall(faddr, llargs);
@@ -5152,7 +5152,7 @@ fn trans_recv(@block_ctxt cx, @ast.expr lhs, @ast.expr rhs,
51525152

51535153
// FIXME: calculate copy init-ness in typestate.
51545154
ret recv_val(bcx, data.res.val, rhs, unit_ty, DROP_EXISTING);
5155-
}
5155+
}
51565156

51575157
fn recv_val(@block_ctxt cx, ValueRef lhs, @ast.expr rhs,
51585158
@ty.t unit_ty, copy_action action) -> result {
@@ -5629,14 +5629,14 @@ fn populate_fn_ctxt_from_llself(@fn_ctxt fcx, ValueRef llself) {
56295629
box_ptr = bcx.build.PointerCast(box_ptr, llobj_box_ty);
56305630

56315631
auto obj_typarams = bcx.build.GEP(box_ptr,
5632-
vec(C_int(0),
5633-
C_int(abi.box_rc_field_body),
5634-
C_int(abi.obj_body_elt_typarams)));
5632+
vec(C_int(0),
5633+
C_int(abi.box_rc_field_body),
5634+
C_int(abi.obj_body_elt_typarams)));
56355635

56365636
// The object fields immediately follow the type parameters, so we skip
56375637
// over them to get the pointer.
56385638
auto obj_fields = bcx.build.Add(vp2i(bcx, obj_typarams),
5639-
llsize_of(llvm.LLVMGetElementType(val_ty(obj_typarams))));
5639+
llsize_of(llvm.LLVMGetElementType(val_ty(obj_typarams))));
56405640

56415641
// If we can (i.e. the type is statically sized), then cast the resulting
56425642
// fields pointer to the appropriate LLVM type. If not, just leave it as
@@ -5938,12 +5938,12 @@ fn trans_tag_variant(@crate_ctxt cx, ast.def_id tag_id,
59385938
// this function as an opaque blob due to the way that type_of()
59395939
// works. So we have to cast to the destination's view of the type.
59405940
auto llargptr = bcx.build.PointerCast(fcx.llargs.get(va.id),
5941-
val_ty(lldestptr));
5941+
val_ty(lldestptr));
59425942

59435943
auto arg_ty = arg_tys.(i).ty;
59445944
auto llargval;
59455945
if (ty.type_is_structural(arg_ty) ||
5946-
ty.type_has_dynamic_size(arg_ty)) {
5946+
ty.type_has_dynamic_size(arg_ty)) {
59475947
llargval = llargptr;
59485948
} else {
59495949
llargval = bcx.build.Load(llargptr);
@@ -6098,7 +6098,7 @@ fn native_fn_ty_param_count(@crate_ctxt cx, &ast.def_id id) -> uint {
60986098
}
60996099

61006100
fn native_fn_wrapper_type(@crate_ctxt cx, uint ty_param_count, &ast.ann ann)
6101-
-> TypeRef {
6101+
-> TypeRef {
61026102
auto x = node_ann_type(cx, ann);
61036103
alt (x.struct) {
61046104
case (ty.ty_native_fn(?abi, ?args, ?out)) {
@@ -6118,7 +6118,7 @@ fn decl_native_fn_and_pair(@crate_ctxt cx,
61186118
auto wrapper_type = native_fn_wrapper_type(cx, num_ty_param, ann);
61196119
let str s = mangle_name_by_seq(cx, "wrapper");
61206120
let ValueRef wrapper_fn = decl_internal_fastcall_fn(cx.llmod, s,
6121-
wrapper_type);
6121+
wrapper_type);
61226122

61236123
// Declare the global constant pair that points to it.
61246124
auto wrapper_pair_type = T_fn_pair(cx.tn, wrapper_type);
@@ -6873,7 +6873,7 @@ fn trans_vec_append_glue(@crate_ctxt cx) {
68736873
put_vec_fill(copy_src_cx, llnew_vec,
68746874
copy_src_cx.build.Add(vec_fill(copy_src_cx,
68756875
llnew_vec),
6876-
n_bytes));
6876+
n_bytes));
68776877

68786878
// Write new_vec back through the alias we were given.
68796879
copy_src_cx.build.Store(llnew_vec, lldst_vec_ptr);

0 commit comments

Comments
 (0)