@@ -136,14 +136,14 @@ pub fn push_ctxt(s: &'static str) -> _InsnCtxt {
136136}
137137
138138pub struct StatRecorder < ' a > {
139- ccx : @ CrateContext < ' a > ,
139+ ccx : & ' a CrateContext < ' a > ,
140140 name : Option < ~str > ,
141141 start : u64 ,
142142 istart : uint ,
143143}
144144
145145impl < ' 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 > {
147147 let start = if ccx. sess ( ) . trans_stats ( ) {
148148 time:: precise_time_ns ( )
149149 } else {
@@ -528,7 +528,7 @@ pub fn note_unique_llvm_symbol(ccx: &CrateContext, sym: ~str) {
528528}
529529
530530
531- pub fn get_res_dtor(ccx: @ CrateContext,
531+ pub fn get_res_dtor(ccx: & CrateContext,
532532 did: ast::DefId,
533533 parent_id: ast::DefId,
534534 substs: &[ty::t])
@@ -1225,7 +1225,7 @@ pub fn make_return_pointer(fcx: &FunctionContext, output_type: ty::t)
12251225//
12261226// Be warned! You must call `init_function` before doing anything with the
12271227// returned function context.
1228- pub fn new_fn_ctxt < ' a > ( ccx : @ CrateContext < ' a > ,
1228+ pub fn new_fn_ctxt < ' a > ( ccx : & ' a CrateContext < ' a > ,
12291229 llfndecl : ValueRef ,
12301230 id : ast:: NodeId ,
12311231 has_env : bool ,
@@ -1443,15 +1443,15 @@ pub fn build_return_block(fcx: &FunctionContext, ret_cx: &Block) {
14431443// trans_closure: Builds an LLVM function out of a source function.
14441444// If the function closes over its environment a closure will be
14451445// 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 > ) {
14551455 ccx. stats. n_closures. set( ccx. stats. n_closures. get ( ) + 1 ) ;
14561456
14571457 let _icx = push_ctxt( "trans_closure" ) ;
@@ -1543,7 +1543,7 @@ pub fn trans_closure<'a>(ccx: @CrateContext,
15431543
15441544// trans_fn: creates an LLVM function corresponding to a source language
15451545// function.
1546- pub fn trans_fn( ccx: @ CrateContext ,
1546+ pub fn trans_fn( ccx: & CrateContext ,
15471547 decl: & ast:: FnDecl ,
15481548 body: & ast:: Block ,
15491549 llfndecl: ValueRef ,
@@ -1558,7 +1558,7 @@ pub fn trans_fn(ccx: @CrateContext,
15581558 param_substs, id, attrs, output_type, |bcx| bcx) ;
15591559}
15601560
1561- pub fn trans_enum_variant( ccx: @ CrateContext ,
1561+ pub fn trans_enum_variant( ccx: & CrateContext ,
15621562 _enum_id: ast:: NodeId ,
15631563 variant: & ast:: Variant ,
15641564 _args: & [ ast:: VariantArg ] ,
@@ -1575,7 +1575,7 @@ pub fn trans_enum_variant(ccx: @CrateContext,
15751575 llfndecl) ;
15761576}
15771577
1578- pub fn trans_tuple_struct( ccx: @ CrateContext ,
1578+ pub fn trans_tuple_struct( ccx: & CrateContext ,
15791579 _fields: & [ ast:: StructField ] ,
15801580 ctor_id: ast:: NodeId ,
15811581 param_substs: Option <@param_substs>,
@@ -1590,7 +1590,7 @@ pub fn trans_tuple_struct(ccx: @CrateContext,
15901590 llfndecl) ;
15911591}
15921592
1593- fn trans_enum_variant_or_tuple_like_struct( ccx: @ CrateContext ,
1593+ fn trans_enum_variant_or_tuple_like_struct( ccx: & CrateContext ,
15941594 ctor_id: ast:: NodeId ,
15951595 disr: ty:: Disr ,
15961596 param_substs: Option <@param_substs>,
@@ -1647,8 +1647,8 @@ fn trans_enum_variant_or_tuple_like_struct(ccx: @CrateContext,
16471647 finish_fn( & fcx, bcx) ;
16481648}
16491649
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 >,
16521652 i: & mut uint) {
16531653 for & variant in enum_definition. variants. iter( ) {
16541654 let disr_val = vi. get( * i) . disr_val;
@@ -1671,7 +1671,7 @@ pub fn trans_enum_def(ccx: @CrateContext, enum_definition: &ast::EnumDef,
16711671}
16721672
16731673pub struct TransItemVisitor <' a> {
1674- ccx: @ CrateContext <' a>,
1674+ ccx: & ' a CrateContext <' a>,
16751675}
16761676
16771677impl <' a> Visitor <( ) > for TransItemVisitor <' a> {
@@ -1680,7 +1680,7 @@ impl<'a> Visitor<()> for TransItemVisitor<'a> {
16801680 }
16811681}
16821682
1683- pub fn trans_item( ccx: @ CrateContext , item: & ast:: Item ) {
1683+ pub fn trans_item( ccx: & CrateContext , item: & ast:: Item ) {
16841684 let _icx = push_ctxt( "trans_item" ) ;
16851685 match item. node {
16861686 ast:: ItemFn ( decl, purity, _abis, ref generics, body) => {
@@ -1757,7 +1757,7 @@ pub fn trans_item(ccx: @CrateContext, item: &ast::Item) {
17571757 }
17581758}
17591759
1760- pub fn trans_struct_def( ccx: @ CrateContext , struct_def: @ast:: StructDef ) {
1760+ pub fn trans_struct_def( ccx: & CrateContext , struct_def: @ast:: StructDef ) {
17611761 // If this is a tuple-like struct, translate the constructor.
17621762 match struct_def. ctor_id {
17631763 // 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) {
17761776// separate modules in the compiled program. That's because modules exist
17771777// only as a convenience for humans working with the code, to organize names
17781778// and control visibility.
1779- pub fn trans_mod( ccx: @ CrateContext , m: & ast:: Mod ) {
1779+ pub fn trans_mod( ccx: & CrateContext , m: & ast:: Mod ) {
17801780 let _icx = push_ctxt( "trans_mod" ) ;
17811781 for item in m. items. iter( ) {
17821782 trans_item( ccx, * item) ;
17831783 }
17841784}
17851785
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 ,
17871787 llfn: ValueRef ) {
17881788 {
17891789 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
18021802 }
18031803}
18041804
1805- fn register_fn( ccx: @ CrateContext ,
1805+ fn register_fn( ccx: & CrateContext ,
18061806 sp: Span ,
18071807 sym: ~str ,
18081808 node_id: ast:: NodeId ,
@@ -1826,7 +1826,7 @@ fn register_fn(ccx: @CrateContext,
18261826}
18271827
18281828// 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 ,
18301830 sp: Span ,
18311831 sym: ~str ,
18321832 node_id: ast:: NodeId ,
@@ -1849,7 +1849,7 @@ pub fn is_entry_fn(sess: &Session, node_id: ast::NodeId) -> bool {
18491849
18501850// Create a _rust_main(args: ~[str]) function which will be called from the
18511851// runtime rust_start function
1852- pub fn create_entry_wrapper( ccx: @ CrateContext ,
1852+ pub fn create_entry_wrapper( ccx: & CrateContext ,
18531853 _sp: Span ,
18541854 main_llfn: ValueRef ) {
18551855 let et = ccx. sess( ) . entry_type. get( ) . unwrap( ) ;
@@ -1861,7 +1861,7 @@ pub fn create_entry_wrapper(ccx: @CrateContext,
18611861 session:: EntryNone => { } // Do nothing.
18621862 }
18631863
1864- fn create_entry_fn( ccx: @ CrateContext ,
1864+ fn create_entry_fn( ccx: & CrateContext ,
18651865 rust_main: ValueRef ,
18661866 use_start_lang_item: bool ) {
18671867 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,
19411941 }
19421942}
19431943
1944- pub fn get_item_val( ccx: @ CrateContext , id: ast:: NodeId ) -> ValueRef {
1944+ pub fn get_item_val( ccx: & CrateContext , id: ast:: NodeId ) -> ValueRef {
19451945 debug!( "get_item_val(id=`{:?}`)" , id) ;
19461946
19471947 let val = {
@@ -2194,7 +2194,7 @@ pub fn get_item_val(ccx: @CrateContext, id: ast::NodeId) -> ValueRef {
21942194 }
21952195}
21962196
2197- fn register_method( ccx: @ CrateContext , id: ast:: NodeId ,
2197+ fn register_method( ccx: & CrateContext , id: ast:: NodeId ,
21982198 m: & ast:: Method ) -> ValueRef {
21992199 let mty = ty:: node_id_to_type( ccx. tcx, id) ;
22002200
@@ -2444,7 +2444,7 @@ pub fn decl_crate_map(sess: &Session, mapmeta: LinkMeta,
24442444 return (sym_name, map);
24452445}
24462446
2447- pub fn fill_crate_map(ccx: @ CrateContext, map: ValueRef) {
2447+ pub fn fill_crate_map(ccx: & CrateContext, map: ValueRef) {
24482448 let event_loop_factory = match ccx.tcx.lang_items.event_loop_factory() {
24492449 Some(did) => unsafe {
24502450 if is_local(did) {
@@ -2551,7 +2551,7 @@ pub fn trans_crate(krate: ast::Crate,
25512551 // 1. http://llvm.org/bugs/show_bug.cgi?id=11479
25522552 let llmod_id = link_meta.crateid.name + " . rs";
25532553
2554- let ccx = @ CrateContext::new(llmod_id,
2554+ let ccx = & CrateContext::new(llmod_id,
25552555 &analysis.ty_cx,
25562556 analysis.exp_map2,
25572557 analysis.maps,
0 commit comments