@@ -136,14 +136,14 @@ pub fn push_ctxt(s: &'static str) -> _InsnCtxt {
136
136
}
137
137
138
138
pub struct StatRecorder < ' a > {
139
- ccx : @ CrateContext < ' a > ,
139
+ ccx : & ' a CrateContext < ' a > ,
140
140
name : Option < ~str > ,
141
141
start : u64 ,
142
142
istart : uint ,
143
143
}
144
144
145
145
impl < ' a > StatRecorder < ' a > {
146
- pub fn new ( ccx : @ CrateContext < ' a > , name : ~str ) -> StatRecorder < ' a > {
146
+ pub fn new ( ccx : & ' a CrateContext < ' a > , name : ~str ) -> StatRecorder < ' a > {
147
147
let start = if ccx. sess ( ) . trans_stats ( ) {
148
148
time:: precise_time_ns ( )
149
149
} else {
@@ -528,7 +528,7 @@ pub fn note_unique_llvm_symbol(ccx: &CrateContext, sym: ~str) {
528
528
}
529
529
530
530
531
- pub fn get_res_dtor(ccx: @ CrateContext,
531
+ pub fn get_res_dtor(ccx: & CrateContext,
532
532
did: ast::DefId,
533
533
parent_id: ast::DefId,
534
534
substs: &[ty::t])
@@ -1225,7 +1225,7 @@ pub fn make_return_pointer(fcx: &FunctionContext, output_type: ty::t)
1225
1225
//
1226
1226
// Be warned! You must call `init_function` before doing anything with the
1227
1227
// returned function context.
1228
- pub fn new_fn_ctxt < ' a > ( ccx : @ CrateContext < ' a > ,
1228
+ pub fn new_fn_ctxt < ' a > ( ccx : & ' a CrateContext < ' a > ,
1229
1229
llfndecl : ValueRef ,
1230
1230
id : ast:: NodeId ,
1231
1231
has_env : bool ,
@@ -1443,15 +1443,15 @@ pub fn build_return_block(fcx: &FunctionContext, ret_cx: &Block) {
1443
1443
// trans_closure: Builds an LLVM function out of a source function.
1444
1444
// If the function closes over its environment a closure will be
1445
1445
// returned.
1446
- pub fn trans_closure< ' a > ( ccx : @ CrateContext ,
1447
- decl : & ast:: FnDecl ,
1448
- body : & ast:: Block ,
1449
- llfndecl : ValueRef ,
1450
- param_substs : Option < @param_substs > ,
1451
- id : ast:: NodeId ,
1452
- _attributes : & [ ast:: Attribute ] ,
1453
- output_type : ty:: t ,
1454
- maybe_load_env: <' b > |& ' b Block < ' b > | -> & ' b Block < ' b > ) {
1446
+ pub fn trans_closure( ccx : & CrateContext ,
1447
+ decl : & ast:: FnDecl ,
1448
+ body : & ast:: Block ,
1449
+ llfndecl : ValueRef ,
1450
+ param_substs : Option < @param_substs > ,
1451
+ id : ast:: NodeId ,
1452
+ _attributes : & [ ast:: Attribute ] ,
1453
+ output_type : ty:: t ,
1454
+ maybe_load_env: <' a > |& ' a Block < ' a > | -> & ' a Block < ' a > ) {
1455
1455
ccx. stats. n_closures. set( ccx. stats. n_closures. get ( ) + 1 ) ;
1456
1456
1457
1457
let _icx = push_ctxt( "trans_closure" ) ;
@@ -1543,7 +1543,7 @@ pub fn trans_closure<'a>(ccx: @CrateContext,
1543
1543
1544
1544
// trans_fn: creates an LLVM function corresponding to a source language
1545
1545
// function.
1546
- pub fn trans_fn( ccx: @ CrateContext ,
1546
+ pub fn trans_fn( ccx: & CrateContext ,
1547
1547
decl: & ast:: FnDecl ,
1548
1548
body: & ast:: Block ,
1549
1549
llfndecl: ValueRef ,
@@ -1558,7 +1558,7 @@ pub fn trans_fn(ccx: @CrateContext,
1558
1558
param_substs, id, attrs, output_type, |bcx| bcx) ;
1559
1559
}
1560
1560
1561
- pub fn trans_enum_variant( ccx: @ CrateContext ,
1561
+ pub fn trans_enum_variant( ccx: & CrateContext ,
1562
1562
_enum_id: ast:: NodeId ,
1563
1563
variant: & ast:: Variant ,
1564
1564
_args: & [ ast:: VariantArg ] ,
@@ -1575,7 +1575,7 @@ pub fn trans_enum_variant(ccx: @CrateContext,
1575
1575
llfndecl) ;
1576
1576
}
1577
1577
1578
- pub fn trans_tuple_struct( ccx: @ CrateContext ,
1578
+ pub fn trans_tuple_struct( ccx: & CrateContext ,
1579
1579
_fields: & [ ast:: StructField ] ,
1580
1580
ctor_id: ast:: NodeId ,
1581
1581
param_substs: Option <@param_substs>,
@@ -1590,7 +1590,7 @@ pub fn trans_tuple_struct(ccx: @CrateContext,
1590
1590
llfndecl) ;
1591
1591
}
1592
1592
1593
- fn trans_enum_variant_or_tuple_like_struct( ccx: @ CrateContext ,
1593
+ fn trans_enum_variant_or_tuple_like_struct( ccx: & CrateContext ,
1594
1594
ctor_id: ast:: NodeId ,
1595
1595
disr: ty:: Disr ,
1596
1596
param_substs: Option <@param_substs>,
@@ -1647,8 +1647,8 @@ fn trans_enum_variant_or_tuple_like_struct(ccx: @CrateContext,
1647
1647
finish_fn( & fcx, bcx) ;
1648
1648
}
1649
1649
1650
- pub fn trans_enum_def( ccx: @ CrateContext , enum_definition: & ast:: EnumDef ,
1651
- id: ast:: NodeId , vi: @Vec <@ty:: VariantInfo > ,
1650
+ pub fn trans_enum_def( ccx: & CrateContext , enum_definition: & ast:: EnumDef ,
1651
+ id: ast:: NodeId , vi: @Vec <@ty:: VariantInfo >,
1652
1652
i: & mut uint) {
1653
1653
for & variant in enum_definition. variants. iter( ) {
1654
1654
let disr_val = vi. get( * i) . disr_val;
@@ -1671,7 +1671,7 @@ pub fn trans_enum_def(ccx: @CrateContext, enum_definition: &ast::EnumDef,
1671
1671
}
1672
1672
1673
1673
pub struct TransItemVisitor <' a> {
1674
- ccx: @ CrateContext <' a>,
1674
+ ccx: & ' a CrateContext <' a>,
1675
1675
}
1676
1676
1677
1677
impl <' a> Visitor <( ) > for TransItemVisitor <' a> {
@@ -1680,7 +1680,7 @@ impl<'a> Visitor<()> for TransItemVisitor<'a> {
1680
1680
}
1681
1681
}
1682
1682
1683
- pub fn trans_item( ccx: @ CrateContext , item: & ast:: Item ) {
1683
+ pub fn trans_item( ccx: & CrateContext , item: & ast:: Item ) {
1684
1684
let _icx = push_ctxt( "trans_item" ) ;
1685
1685
match item. node {
1686
1686
ast:: ItemFn ( decl, purity, _abis, ref generics, body) => {
@@ -1757,7 +1757,7 @@ pub fn trans_item(ccx: @CrateContext, item: &ast::Item) {
1757
1757
}
1758
1758
}
1759
1759
1760
- pub fn trans_struct_def( ccx: @ CrateContext , struct_def: @ast:: StructDef ) {
1760
+ pub fn trans_struct_def( ccx: & CrateContext , struct_def: @ast:: StructDef ) {
1761
1761
// If this is a tuple-like struct, translate the constructor.
1762
1762
match struct_def. ctor_id {
1763
1763
// We only need to translate a constructor if there are fields;
@@ -1776,14 +1776,14 @@ pub fn trans_struct_def(ccx: @CrateContext, struct_def: @ast::StructDef) {
1776
1776
// separate modules in the compiled program. That's because modules exist
1777
1777
// only as a convenience for humans working with the code, to organize names
1778
1778
// and control visibility.
1779
- pub fn trans_mod( ccx: @ CrateContext , m: & ast:: Mod ) {
1779
+ pub fn trans_mod( ccx: & CrateContext , m: & ast:: Mod ) {
1780
1780
let _icx = push_ctxt( "trans_mod" ) ;
1781
1781
for item in m. items. iter( ) {
1782
1782
trans_item( ccx, * item) ;
1783
1783
}
1784
1784
}
1785
1785
1786
- fn finish_register_fn( ccx: @ CrateContext , sp: Span , sym: ~str , node_id: ast:: NodeId ,
1786
+ fn finish_register_fn( ccx: & CrateContext , sp: Span , sym: ~str , node_id: ast:: NodeId ,
1787
1787
llfn: ValueRef ) {
1788
1788
{
1789
1789
let mut item_symbols = ccx. item_symbols. borrow_mut( ) ;
@@ -1802,7 +1802,7 @@ fn finish_register_fn(ccx: @CrateContext, sp: Span, sym: ~str, node_id: ast::Nod
1802
1802
}
1803
1803
}
1804
1804
1805
- fn register_fn( ccx: @ CrateContext ,
1805
+ fn register_fn( ccx: & CrateContext ,
1806
1806
sp: Span ,
1807
1807
sym: ~str ,
1808
1808
node_id: ast:: NodeId ,
@@ -1826,7 +1826,7 @@ fn register_fn(ccx: @CrateContext,
1826
1826
}
1827
1827
1828
1828
// only use this for foreign function ABIs and glue, use `register_fn` for Rust functions
1829
- pub fn register_fn_llvmty( ccx: @ CrateContext ,
1829
+ pub fn register_fn_llvmty( ccx: & CrateContext ,
1830
1830
sp: Span ,
1831
1831
sym: ~str ,
1832
1832
node_id: ast:: NodeId ,
@@ -1849,7 +1849,7 @@ pub fn is_entry_fn(sess: &Session, node_id: ast::NodeId) -> bool {
1849
1849
1850
1850
// Create a _rust_main(args: ~[str]) function which will be called from the
1851
1851
// runtime rust_start function
1852
- pub fn create_entry_wrapper( ccx: @ CrateContext ,
1852
+ pub fn create_entry_wrapper( ccx: & CrateContext ,
1853
1853
_sp: Span ,
1854
1854
main_llfn: ValueRef ) {
1855
1855
let et = ccx. sess( ) . entry_type. get( ) . unwrap( ) ;
@@ -1861,7 +1861,7 @@ pub fn create_entry_wrapper(ccx: @CrateContext,
1861
1861
session:: EntryNone => { } // Do nothing.
1862
1862
}
1863
1863
1864
- fn create_entry_fn( ccx: @ CrateContext ,
1864
+ fn create_entry_fn( ccx: & CrateContext ,
1865
1865
rust_main: ValueRef ,
1866
1866
use_start_lang_item: bool ) {
1867
1867
let llfty = Type :: func( [ ccx. int_type, Type :: i8 ( ) . ptr_to( ) . ptr_to( ) ] ,
@@ -1941,7 +1941,7 @@ fn exported_name(ccx: &CrateContext, id: ast::NodeId,
1941
1941
}
1942
1942
}
1943
1943
1944
- pub fn get_item_val( ccx: @ CrateContext , id: ast:: NodeId ) -> ValueRef {
1944
+ pub fn get_item_val( ccx: & CrateContext , id: ast:: NodeId ) -> ValueRef {
1945
1945
debug!( "get_item_val(id=`{:?}`)" , id) ;
1946
1946
1947
1947
let val = {
@@ -2194,7 +2194,7 @@ pub fn get_item_val(ccx: @CrateContext, id: ast::NodeId) -> ValueRef {
2194
2194
}
2195
2195
}
2196
2196
2197
- fn register_method( ccx: @ CrateContext , id: ast:: NodeId ,
2197
+ fn register_method( ccx: & CrateContext , id: ast:: NodeId ,
2198
2198
m: & ast:: Method ) -> ValueRef {
2199
2199
let mty = ty:: node_id_to_type( ccx. tcx, id) ;
2200
2200
@@ -2444,7 +2444,7 @@ pub fn decl_crate_map(sess: &Session, mapmeta: LinkMeta,
2444
2444
return (sym_name, map);
2445
2445
}
2446
2446
2447
- pub fn fill_crate_map(ccx: @ CrateContext, map: ValueRef) {
2447
+ pub fn fill_crate_map(ccx: & CrateContext, map: ValueRef) {
2448
2448
let event_loop_factory = match ccx.tcx.lang_items.event_loop_factory() {
2449
2449
Some(did) => unsafe {
2450
2450
if is_local(did) {
@@ -2551,7 +2551,7 @@ pub fn trans_crate(krate: ast::Crate,
2551
2551
// 1. http://llvm.org/bugs/show_bug.cgi?id=11479
2552
2552
let llmod_id = link_meta.crateid.name + " . rs";
2553
2553
2554
- let ccx = @ CrateContext::new(llmod_id,
2554
+ let ccx = & CrateContext::new(llmod_id,
2555
2555
&analysis.ty_cx,
2556
2556
analysis.exp_map2,
2557
2557
analysis.maps,
0 commit comments