@@ -26,6 +26,7 @@ import util::common::istr;
26
26
import util:: common:: new_def_hash;
27
27
import util:: common:: new_str_hash;
28
28
import util:: common:: local_rhs_span;
29
+ import util:: common:: span;
29
30
30
31
import lib:: llvm:: llvm;
31
32
import lib:: llvm:: builder;
@@ -215,7 +216,7 @@ state type fn_ctxt = rec(
215
216
hashmap[ ty:: t, derived_tydesc_info] derived_tydescs ,
216
217
217
218
// The source span where this function comes from, for error reporting.
218
- ast :: span sp,
219
+ span sp,
219
220
220
221
// This function's enclosing local context.
221
222
@local_ctxt lcx
@@ -273,7 +274,7 @@ state type block_ctxt = rec(
273
274
mutable vec[ cleanup] cleanups ,
274
275
275
276
// The source span where this block comes from, for error reporting.
276
- ast :: span sp,
277
+ span sp,
277
278
278
279
// The function context for the function to which this block is attached.
279
280
@fn_ctxt fcx
@@ -502,7 +503,7 @@ fn T_glue_fn(&type_names tn) -> TypeRef {
502
503
ret t;
503
504
}
504
505
505
- fn T_dtor ( & @crate_ctxt ccx , & ast :: span sp, TypeRef llself_ty ) -> TypeRef {
506
+ fn T_dtor ( & @crate_ctxt ccx , & span sp, TypeRef llself_ty ) -> TypeRef {
506
507
ret type_of_fn_full ( ccx, sp, ast:: proto_fn, some[ TypeRef ] ( llself_ty) ,
507
508
vec:: empty[ ty:: arg] ( ) , ty:: mk_nil ( ccx. tcx ) , 0 u) ;
508
509
}
@@ -693,7 +694,7 @@ fn T_opaque_chan_ptr() -> TypeRef { ret T_ptr(T_i8()); }
693
694
// return value was always meaningless in that case anyhow). Beware!
694
695
//
695
696
// TODO: Enforce via a predicate.
696
- fn type_of ( & @crate_ctxt cx , & ast :: span sp, & ty:: t t) -> TypeRef {
697
+ fn type_of ( & @crate_ctxt cx , & span sp, & ty:: t t) -> TypeRef {
697
698
if ( ty:: type_has_dynamic_size ( cx. tcx , t) ) {
698
699
cx. sess . span_err ( sp,
699
700
"type_of() called on a type with dynamic size: " +
@@ -704,7 +705,7 @@ fn type_of(&@crate_ctxt cx, &ast::span sp, &ty::t t) -> TypeRef {
704
705
ret type_of_inner ( cx, sp, t) ;
705
706
}
706
707
707
- fn type_of_explicit_args ( & @crate_ctxt cx , & ast :: span sp,
708
+ fn type_of_explicit_args ( & @crate_ctxt cx , & span sp,
708
709
& vec[ ty:: arg ] inputs ) -> vec[ TypeRef ] {
709
710
let vec[ TypeRef ] atys = [ ] ;
710
711
for ( ty:: arg arg in inputs) {
@@ -735,7 +736,7 @@ fn type_of_explicit_args(&@crate_ctxt cx, &ast::span sp,
735
736
// - trans_args
736
737
737
738
fn type_of_fn_full ( & @crate_ctxt cx ,
738
- & ast :: span sp,
739
+ & span sp,
739
740
ast:: proto proto,
740
741
& option:: t[ TypeRef ] obj_self ,
741
742
& vec[ ty:: arg ] inputs ,
@@ -792,7 +793,7 @@ fn type_of_fn_full(&@crate_ctxt cx,
792
793
}
793
794
794
795
fn type_of_fn ( & @crate_ctxt cx ,
795
- & ast :: span sp,
796
+ & span sp,
796
797
ast:: proto proto,
797
798
& vec[ ty:: arg ] inputs ,
798
799
& ty:: t output ,
@@ -801,7 +802,7 @@ fn type_of_fn(&@crate_ctxt cx,
801
802
ty_param_count) ;
802
803
}
803
804
804
- fn type_of_native_fn ( & @crate_ctxt cx , & ast :: span sp, ast:: native_abi abi,
805
+ fn type_of_native_fn ( & @crate_ctxt cx , & span sp, ast:: native_abi abi,
805
806
& vec[ ty:: arg ] inputs ,
806
807
& ty:: t output ,
807
808
uint ty_param_count ) -> TypeRef {
@@ -819,7 +820,7 @@ fn type_of_native_fn(&@crate_ctxt cx, &ast::span sp, ast::native_abi abi,
819
820
ret T_fn ( atys, type_of_inner ( cx, sp, output) ) ;
820
821
}
821
822
822
- fn type_of_inner ( & @crate_ctxt cx , & ast :: span sp, & ty:: t t) -> TypeRef {
823
+ fn type_of_inner ( & @crate_ctxt cx , & span sp, & ty:: t t) -> TypeRef {
823
824
// Check the cache.
824
825
if ( cx. lltypes . contains_key ( t) ) {
825
826
ret cx. lltypes . get ( t) ;
@@ -939,7 +940,7 @@ fn type_of_inner(&@crate_ctxt cx, &ast::span sp, &ty::t t) -> TypeRef {
939
940
ret llty;
940
941
}
941
942
942
- fn type_of_arg ( @local_ctxt cx , & ast :: span sp, & ty:: arg arg) -> TypeRef {
943
+ fn type_of_arg ( @local_ctxt cx , & span sp, & ty:: arg arg) -> TypeRef {
943
944
alt ( ty:: struct ( cx. ccx . tcx , arg. ty ) ) {
944
945
case ( ty:: ty_param ( _) ) {
945
946
if ( arg. mode == ty:: mo_alias) {
@@ -960,7 +961,7 @@ fn type_of_arg(@local_ctxt cx, &ast::span sp, &ty::arg arg) -> TypeRef {
960
961
ret typ;
961
962
}
962
963
963
- fn type_of_ty_param_count_and_ty ( @local_ctxt lcx , & ast :: span sp,
964
+ fn type_of_ty_param_count_and_ty ( @local_ctxt lcx , & span sp,
964
965
& ty:: ty_param_count_and_ty tpt) -> TypeRef {
965
966
alt ( ty:: struct ( lcx. ccx . tcx , tpt. _1 ) ) {
966
967
case ( ty:: ty_fn ( ?proto, ?inputs, ?output, _) ) {
@@ -1284,7 +1285,7 @@ fn simplify_type(&@crate_ctxt ccx, &ty::t typ) -> ty::t {
1284
1285
}
1285
1286
1286
1287
// Computes the size of the data part of a non-dynamically-sized tag.
1287
- fn static_size_of_tag( & @crate_ctxt cx , & ast :: span sp, & ty:: t t) -> uint {
1288
+ fn static_size_of_tag( & @crate_ctxt cx , & span sp, & ty:: t t) -> uint {
1288
1289
if ( ty:: type_has_dynamic_size ( cx. tcx , t) ) {
1289
1290
log_err "dynamically sized type passed to static_size_of_tag()" ;
1290
1291
fail;
@@ -1841,7 +1842,7 @@ fn set_glue_inlining(&@local_ctxt cx, ValueRef f, &ty::t t) {
1841
1842
1842
1843
1843
1844
// Generates the declaration for (but doesn't emit) a type descriptor.
1844
- fn declare_tydesc( & @local_ctxt cx, & ast :: span sp, & ty:: t t,
1845
+ fn declare_tydesc( & @local_ctxt cx, & span sp, & ty:: t t,
1845
1846
vec[ uint] ty_params) -> @tydesc_info {
1846
1847
log "+++ declare_tydesc " + ty:: ty_to_str( cx. ccx. tcx, t) ;
1847
1848
auto ccx = cx. ccx;
@@ -1905,7 +1906,7 @@ fn declare_generic_glue(&@local_ctxt cx,
1905
1906
ret llfn;
1906
1907
}
1907
1908
1908
- fn make_generic_glue( & @local_ctxt cx, & ast :: span sp,
1909
+ fn make_generic_glue( & @local_ctxt cx, & span sp,
1909
1910
& ty:: t t,
1910
1911
ValueRef llfn,
1911
1912
& make_generic_glue_helper_fn helper,
@@ -3356,7 +3357,7 @@ fn node_ann_type(&@crate_ctxt cx, &ast::ann a) -> ty::t {
3356
3357
ret ty:: ann_to_monotype( cx. tcx, a) ;
3357
3358
}
3358
3359
3359
- fn node_type( & @crate_ctxt cx, & ast :: span sp, & ast:: ann a) -> TypeRef {
3360
+ fn node_type( & @crate_ctxt cx, & span sp, & ast:: ann a) -> TypeRef {
3360
3361
ret type_of( cx, sp, node_ann_type( cx, a) ) ;
3361
3362
}
3362
3363
@@ -4539,7 +4540,7 @@ fn trans_path(&@block_ctxt cx, &ast::path p, &ast::ann ann) -> lval_result {
4539
4540
}
4540
4541
}
4541
4542
4542
- fn trans_field( & @block_ctxt cx, & ast :: span sp, ValueRef v, & ty:: t t0,
4543
+ fn trans_field( & @block_ctxt cx, & span sp, ValueRef v, & ty:: t t0,
4543
4544
& ast:: ident field, & ast:: ann ann) -> lval_result {
4544
4545
4545
4546
auto r = autoderef( cx, v, t0) ;
@@ -4580,7 +4581,7 @@ fn trans_field(&@block_ctxt cx, &ast::span sp, ValueRef v, &ty::t t0,
4580
4581
fail;
4581
4582
}
4582
4583
4583
- fn trans_index( & @block_ctxt cx, & ast :: span sp, & @ast:: expr base,
4584
+ fn trans_index( & @block_ctxt cx, & span sp, & @ast:: expr base,
4584
4585
& @ast:: expr idx, & ast:: ann ann) -> lval_result {
4585
4586
4586
4587
auto lv = trans_expr( cx, base) ;
@@ -4727,7 +4728,7 @@ fn trans_cast(&@block_ctxt cx, &@ast::expr e, &ast::ann ann) -> result {
4727
4728
}
4728
4729
4729
4730
fn trans_bind_thunk ( & @local_ctxt cx ,
4730
- & ast :: span sp,
4731
+ & span sp,
4731
4732
& ty:: t incoming_fty ,
4732
4733
& ty:: t outgoing_fty ,
4733
4734
& vec[ option:: t[ @ast:: expr ] ] args,
@@ -6318,7 +6319,7 @@ fn recv_val(&@block_ctxt cx, ValueRef lhs, &@ast::expr rhs,
6318
6319
wrapped inner object.
6319
6320
6320
6321
*/
6321
- fn trans_anon_obj ( & @block_ctxt cx , & ast :: span sp,
6322
+ fn trans_anon_obj ( & @block_ctxt cx , & span sp,
6322
6323
& ast:: anon_obj anon_obj,
6323
6324
& vec[ ast:: ty_param ] ty_params ,
6324
6325
& ast:: obj_def_ids oid,
@@ -6669,7 +6670,7 @@ fn mk_standard_basic_blocks(ValueRef llfn) ->
6669
6670
// - new_fn_ctxt
6670
6671
// - trans_args
6671
6672
6672
- fn new_fn_ctxt ( @local_ctxt cx , & ast :: span sp,
6673
+ fn new_fn_ctxt ( @local_ctxt cx , & span sp,
6673
6674
ValueRef llfndecl) -> @fn_ctxt {
6674
6675
6675
6676
let ValueRef llretptr = llvm:: LLVMGetParam ( llfndecl, 0 u) ;
@@ -6919,7 +6920,7 @@ fn finish_fn(&@fn_ctxt fcx, BasicBlockRef lltop) {
6919
6920
6920
6921
// trans_fn: creates an LLVM function corresponding to a source language
6921
6922
// function.
6922
- fn trans_fn( @local_ctxt cx, & ast :: span sp, & ast:: _fn f, ast:: def_id fid,
6923
+ fn trans_fn( @local_ctxt cx, & span sp, & ast:: _fn f, ast:: def_id fid,
6923
6924
option:: t[ tup( TypeRef , ty:: t) ] ty_self,
6924
6925
& vec[ ast:: ty_param] ty_params, & ast:: ann ann) {
6925
6926
auto llfndecl = cx. ccx. item_ids. get( fid) ;
@@ -7043,7 +7044,7 @@ fn trans_dtor(@local_ctxt cx,
7043
7044
7044
7045
// trans_obj: creates an LLVM function that is the object constructor for the
7045
7046
// object being translated.
7046
- fn trans_obj( @local_ctxt cx, & ast :: span sp, & ast:: _obj ob, ast:: def_id oid,
7047
+ fn trans_obj( @local_ctxt cx, & span sp, & ast:: _obj ob, ast:: def_id oid,
7047
7048
& vec[ ast:: ty_param] ty_params, & ast:: ann ann) {
7048
7049
// To make a function, we have to create a function context and, inside
7049
7050
// that, a number of block contexts for which code is generated.
@@ -7368,7 +7369,7 @@ fn get_pair_fn_ty(TypeRef llpairty) -> TypeRef {
7368
7369
ret llvm:: LLVMGetElementType ( pair_tys. ( 0 ) ) ;
7369
7370
}
7370
7371
7371
- fn decl_fn_and_pair( & @crate_ctxt ccx, & ast :: span sp,
7372
+ fn decl_fn_and_pair( & @crate_ctxt ccx, & span sp,
7372
7373
vec[ str] path,
7373
7374
str flav,
7374
7375
vec[ ast:: ty_param] ty_params,
@@ -7434,7 +7435,7 @@ fn native_fn_ty_param_count(&@crate_ctxt cx, &ast::def_id id) -> uint {
7434
7435
ret count;
7435
7436
}
7436
7437
7437
- fn native_fn_wrapper_type( & @crate_ctxt cx, & ast :: span sp, uint ty_param_count,
7438
+ fn native_fn_wrapper_type( & @crate_ctxt cx, & span sp, uint ty_param_count,
7438
7439
ty:: t x) -> TypeRef {
7439
7440
alt ( ty:: struct( cx. tcx, x) ) {
7440
7441
case ( ty:: ty_native_fn( ?abi, ?args, ?out) ) {
@@ -7445,7 +7446,7 @@ fn native_fn_wrapper_type(&@crate_ctxt cx, &ast::span sp, uint ty_param_count,
7445
7446
}
7446
7447
7447
7448
fn decl_native_fn_and_pair( & @crate_ctxt ccx,
7448
- & ast :: span sp,
7449
+ & span sp,
7449
7450
vec[ str] path,
7450
7451
str name,
7451
7452
& ast:: ann ann,
0 commit comments