@@ -16,10 +16,10 @@ use lib::llvm::llvm;
1616use lib:: llvm:: { ModuleRef , mk_pass_manager, mk_target_data, True , False } ;
1717use lib:: llvm:: { PassManagerRef , FileType } ;
1818use lib;
19- use metadata:: common:: link_meta ;
19+ use metadata:: common:: LinkMeta ;
2020use metadata:: filesearch;
2121use metadata:: { encoder, cstore} ;
22- use middle:: trans:: common:: crate_ctxt ;
22+ use middle:: trans:: common:: CrateContext ;
2323use middle:: ty;
2424use session:: Session ;
2525use session;
@@ -451,15 +451,16 @@ pub mod write {
451451 */
452452
453453pub fn build_link_meta ( sess : Session , c : & ast:: crate , output : & Path ,
454- symbol_hasher : & hash:: State ) -> link_meta {
454+ symbol_hasher : & hash:: State ) -> LinkMeta {
455455
456- type provided_metas =
457- { name : Option < @str > ,
458- vers : Option < @str > ,
459- cmh_items : ~[ @ast:: meta_item ] } ;
456+ struct ProvidedMetas {
457+ name : Option < @str > ,
458+ vers : Option < @str > ,
459+ cmh_items : ~[ @ast:: meta_item ]
460+ }
460461
461462 fn provided_link_metas ( sess : Session , c : & ast:: crate ) ->
462- provided_metas {
463+ ProvidedMetas {
463464 let mut name = None ;
464465 let mut vers = None ;
465466 let mut cmh_items = ~[ ] ;
@@ -480,7 +481,12 @@ pub fn build_link_meta(sess: Session, c: &ast::crate, output: &Path,
480481 }
481482 } else { cmh_items. push ( * meta) ; }
482483 }
483- return { name: name, vers: vers, cmh_items: cmh_items} ;
484+
485+ ProvidedMetas {
486+ name : name,
487+ vers : vers,
488+ cmh_items : cmh_items
489+ }
484490 }
485491
486492 // This calculates CMH as defined above
@@ -563,16 +569,23 @@ pub fn build_link_meta(sess: Session, c: &ast::crate, output: &Path,
563569 } ;
564570 }
565571
566- let { name: opt_name , vers: opt_vers ,
567- cmh_items : cmh_items } = provided_link_metas ( sess, c) ;
572+ let ProvidedMetas {
573+ name : opt_name,
574+ vers : opt_vers,
575+ cmh_items : cmh_items
576+ } = provided_link_metas ( sess, c) ;
568577 let name = crate_meta_name ( sess, output, opt_name) ;
569578 let vers = crate_meta_vers ( sess, opt_vers) ;
570579 let dep_hashes = cstore:: get_dep_hashes ( sess. cstore ) ;
571580 let extras_hash =
572581 crate_meta_extras_hash ( symbol_hasher, cmh_items,
573582 dep_hashes) ;
574583
575- return { name: name, vers: vers, extras_hash: extras_hash} ;
584+ LinkMeta {
585+ name : name,
586+ vers : vers,
587+ extras_hash : extras_hash
588+ }
576589}
577590
578591pub fn truncated_hash_result ( symbol_hasher : & hash:: State ) -> ~str {
@@ -584,7 +597,7 @@ pub fn truncated_hash_result(symbol_hasher: &hash::State) -> ~str {
584597
585598// This calculates STH for a symbol, as defined above
586599pub fn symbol_hash( tcx : ty:: ctxt , symbol_hasher : & hash:: State , t : ty:: t ,
587- link_meta : link_meta ) -> @str {
600+ link_meta : LinkMeta ) -> @str {
588601 // NB: do *not* use abbrevs here as we want the symbol names
589602 // to be independent of one another in the crate.
590603
@@ -601,7 +614,7 @@ pub fn symbol_hash(tcx: ty::ctxt, symbol_hasher: &hash::State, t: ty::t,
601614 hash.to_managed()
602615}
603616
604- pub fn get_symbol_hash(ccx: @crate_ctxt , t: ty::t) -> @str {
617+ pub fn get_symbol_hash(ccx: @CrateContext , t: ty::t) -> @str {
605618 match ccx.type_hashcodes.find(&t) {
606619 Some(h) => h,
607620 None => {
@@ -673,14 +686,16 @@ pub fn exported_name(sess: Session,
673686 path_name ( sess. ident_of ( vers. to_owned ( ) ) ) ) ) ;
674687}
675688
676- pub fn mangle_exported_name ( ccx : @crate_ctxt , +path : path, t : ty:: t ) -> ~str {
689+ pub fn mangle_exported_name ( ccx : @CrateContext ,
690+ +path : path,
691+ t : ty:: t ) -> ~str {
677692 let hash = get_symbol_hash ( ccx, t) ;
678693 return exported_name ( ccx. sess , path,
679694 hash,
680695 ccx. link_meta . vers ) ;
681696}
682697
683- pub fn mangle_internal_name_by_type_only ( ccx : @crate_ctxt ,
698+ pub fn mangle_internal_name_by_type_only ( ccx : @CrateContext ,
684699 t : ty:: t ,
685700 name : & str ) -> ~str {
686701 let s = ppaux:: ty_to_short_str ( ccx. tcx , t) ;
@@ -691,23 +706,23 @@ pub fn mangle_internal_name_by_type_only(ccx: @crate_ctxt,
691706 path_name ( ccx. sess . ident_of ( hash. to_owned ( ) ) ) ] ) ;
692707}
693708
694- pub fn mangle_internal_name_by_path_and_seq ( ccx : @crate_ctxt ,
709+ pub fn mangle_internal_name_by_path_and_seq ( ccx : @CrateContext ,
695710 +path : path,
696711 +flav : ~str ) -> ~str {
697712 return mangle ( ccx. sess ,
698713 vec:: append_one ( path, path_name ( ( ccx. names ) ( flav) ) ) ) ;
699714}
700715
701- pub fn mangle_internal_name_by_path ( ccx : @crate_ctxt , +path : path) -> ~str {
716+ pub fn mangle_internal_name_by_path ( ccx : @CrateContext , +path : path) -> ~str {
702717 return mangle ( ccx. sess , path) ;
703718}
704719
705- pub fn mangle_internal_name_by_seq ( ccx : @crate_ctxt , +flav : ~str ) -> ~str {
720+ pub fn mangle_internal_name_by_seq ( ccx : @CrateContext , +flav : ~str ) -> ~str {
706721 return fmt ! ( "%s_%u" , flav, ( ccx. names) ( flav) . repr) ;
707722}
708723
709724
710- pub fn output_dll_filename ( os : session:: os , lm : link_meta ) -> ~str {
725+ pub fn output_dll_filename ( os : session:: os , lm : LinkMeta ) -> ~str {
711726 let libname = fmt ! ( "%s-%s-%s" , lm. name, lm. extras_hash, lm. vers) ;
712727 let ( dll_prefix, dll_suffix) = match os {
713728 session:: os_win32 => ( win32:: DLL_PREFIX , win32:: DLL_SUFFIX ) ,
@@ -725,7 +740,7 @@ pub fn output_dll_filename(os: session::os, lm: link_meta) -> ~str {
725740pub fn link_binary( sess : Session ,
726741 obj_filename : & Path ,
727742 out_filename : & Path ,
728- lm : link_meta ) {
743+ lm : LinkMeta ) {
729744 // Converts a library file-stem into a cc -l argument
730745 fn unlib ( config : @session:: config , +stem : ~str ) -> ~str {
731746 if stem. starts_with ( "lib" ) &&
0 commit comments