@@ -180,8 +180,16 @@ type fn_ctxt =
180
180
// env*, int, int). These are also available via
181
181
// llvm::LLVMGetParam(llfn, uint) where uint = 1, 2, 0 respectively,
182
182
// but we unpack them into these fields for convenience.
183
+
184
+ // Points to the current task.
183
185
ValueRef lltaskptr ,
186
+
187
+ // Points to the current environment (bindings of variables to
188
+ // values), if this is a regular function; points to the current
189
+ // object, if this is a method.
184
190
ValueRef llenv,
191
+
192
+ // Points to where the return value of this function should end up.
185
193
ValueRef llretptr,
186
194
187
195
// The next three elements: "hoisted basic blocks" containing
@@ -1726,19 +1734,19 @@ fn get_derived_tydesc(&@block_ctxt cx, &ty::t t, bool escapes,
1726
1734
1727
1735
fn get_tydesc( & @block_ctxt cx, & ty:: t t, bool escapes,
1728
1736
& mutable option:: t[ @tydesc_info] static_ti) -> result {
1729
- // Is the supplied type a type param? If so, return the passed-in tydesc.
1730
1737
1738
+ // Is the supplied type a type param? If so, return the passed-in tydesc.
1731
1739
alt ( ty:: type_param( cx. fcx. lcx. ccx. tcx, t) ) {
1732
1740
case ( some( ?id) ) { ret rslt( cx, cx. fcx. lltydescs. ( id) ) ; }
1733
1741
case ( none) { /* fall through */ }
1734
1742
}
1735
- // Does it contain a type param? If so, generate a derived tydesc.
1736
1743
1744
+ // Does it contain a type param? If so, generate a derived tydesc.
1737
1745
if ( ty:: type_contains_params( cx. fcx. lcx. ccx. tcx, t) ) {
1738
1746
ret get_derived_tydesc( cx, t, escapes, static_ti) ;
1739
1747
}
1740
- // Otherwise, generate a tydesc if necessary, and return it.
1741
1748
1749
+ // Otherwise, generate a tydesc if necessary, and return it.
1742
1750
auto info = get_static_tydesc( cx, t, [ ] ) ;
1743
1751
static_ti = some[ @tydesc_info] ( info) ;
1744
1752
ret rslt( cx, info. tydesc) ;
@@ -5003,8 +5011,8 @@ fn trans_field(&@block_ctxt cx, &span sp, ValueRef v, &ty::t t0,
5003
5011
r. bcx. build. GEP ( r. val,
5004
5012
[ C_int ( 0 ) , C_int ( abi:: obj_field_vtbl) ] ) ;
5005
5013
vtbl = r. bcx. build. Load ( vtbl) ;
5006
- // +1 because slot #0 contains the destructor
5007
5014
5015
+ // +1 because slot #0 contains the destructor
5008
5016
auto v = r. bcx. build. GEP ( vtbl, [ C_int ( 0 ) , C_int ( ix + 1 u as int) ] ) ;
5009
5017
auto lvo = lval_mem( r. bcx, v) ;
5010
5018
let ty:: t fn_ty =
@@ -7760,11 +7768,10 @@ fn trans_fn(@local_ctxt cx, &span sp, &ast::_fn f, ValueRef llfndecl,
7760
7768
if ( !is_terminated( rslt. bcx) ) {
7761
7769
// FIXME: until LLVM has a unit type, we are moving around
7762
7770
// C_nil values rather than their void type.
7763
-
7764
7771
rslt. bcx. build. RetVoid ( ) ;
7765
7772
}
7766
- // Insert the mandatory first few basic blocks before lltop.
7767
7773
7774
+ // Insert the mandatory first few basic blocks before lltop.
7768
7775
finish_fn( fcx, lltop) ;
7769
7776
}
7770
7777
0 commit comments