@@ -12,8 +12,9 @@ use back::archive::{Archive, METADATA_FILENAME};
1212use back:: rpath;
1313use back:: svh:: Svh ;
1414use driver:: driver:: { CrateTranslation , OutputFilenames } ;
15- use driver:: session:: { NoDebugInfo , Session } ;
16- use driver:: session;
15+ use driver:: config:: NoDebugInfo ;
16+ use driver:: session:: Session ;
17+ use driver:: config;
1718use lib:: llvm:: llvm;
1819use lib:: llvm:: ModuleRef ;
1920use lib;
@@ -92,8 +93,9 @@ pub mod write {
9293 use back:: link:: { OutputTypeExe , OutputTypeLlvmAssembly } ;
9394 use back:: link:: { OutputTypeObject } ;
9495 use driver:: driver:: { CrateTranslation , OutputFilenames } ;
95- use driver:: session:: { NoDebugInfo , Session } ;
96- use driver:: session;
96+ use driver:: config:: NoDebugInfo ;
97+ use driver:: session:: Session ;
98+ use driver:: config;
9799 use lib:: llvm:: llvm;
98100 use lib:: llvm:: { ModuleRef , TargetMachineRef , PassManagerRef } ;
99101 use lib;
@@ -139,10 +141,10 @@ pub mod write {
139141 }
140142
141143 let opt_level = match sess. opts . optimize {
142- session :: No => lib:: llvm:: CodeGenLevelNone ,
143- session :: Less => lib:: llvm:: CodeGenLevelLess ,
144- session :: Default => lib:: llvm:: CodeGenLevelDefault ,
145- session :: Aggressive => lib:: llvm:: CodeGenLevelAggressive ,
144+ config :: No => lib:: llvm:: CodeGenLevelNone ,
145+ config :: Less => lib:: llvm:: CodeGenLevelLess ,
146+ config :: Default => lib:: llvm:: CodeGenLevelDefault ,
147+ config :: Aggressive => lib:: llvm:: CodeGenLevelAggressive ,
146148 } ;
147149 let use_softfp = sess. opts . cg . soft_float ;
148150
@@ -231,7 +233,7 @@ pub mod write {
231233 // emitting an rlib. Whenever an rlib is created, the bytecode is
232234 // inserted into the archive in order to allow LTO against it.
233235 if sess. opts . cg . save_temps ||
234- ( sess. crate_types . borrow ( ) . contains ( & session :: CrateTypeRlib ) &&
236+ ( sess. crate_types . borrow ( ) . contains ( & config :: CrateTypeRlib ) &&
235237 sess. opts . output_types . contains ( & OutputTypeExe ) ) {
236238 output. temp_path ( OutputTypeBitcode ) . with_c_str ( |buf| {
237239 llvm:: LLVMWriteBitcodeToFile ( llmod, buf) ;
@@ -378,10 +380,10 @@ pub mod write {
378380 // Copy what clang does by turning on loop vectorization at O2 and
379381 // slp vectorization at O3
380382 let vectorize_loop = !sess. opts . cg . no_vectorize_loops &&
381- ( sess. opts . optimize == session :: Default ||
382- sess. opts . optimize == session :: Aggressive ) ;
383+ ( sess. opts . optimize == config :: Default ||
384+ sess. opts . optimize == config :: Aggressive ) ;
383385 let vectorize_slp = !sess. opts . cg . no_vectorize_slp &&
384- sess. opts . optimize == session :: Aggressive ;
386+ sess. opts . optimize == config :: Aggressive ;
385387
386388 let mut llvm_c_strs = Vec :: new ( ) ;
387389 let mut llvm_args = Vec :: new ( ) ;
@@ -823,14 +825,14 @@ fn is_writeable(p: &Path) -> bool {
823825 }
824826}
825827
826- pub fn filename_for_input ( sess : & Session , crate_type : session :: CrateType ,
828+ pub fn filename_for_input ( sess : & Session , crate_type : config :: CrateType ,
827829 id : & CrateId , out_filename : & Path ) -> Path {
828830 let libname = output_lib_filename ( id) ;
829831 match crate_type {
830- session :: CrateTypeRlib => {
832+ config :: CrateTypeRlib => {
831833 out_filename. with_filename ( format ! ( "lib{}.rlib" , libname) )
832834 }
833- session :: CrateTypeDylib => {
835+ config :: CrateTypeDylib => {
834836 let ( prefix, suffix) = match sess. targ_cfg . os {
835837 abi:: OsWin32 => ( loader:: WIN32_DLL_PREFIX , loader:: WIN32_DLL_SUFFIX ) ,
836838 abi:: OsMacos => ( loader:: MACOS_DLL_PREFIX , loader:: MACOS_DLL_SUFFIX ) ,
@@ -840,16 +842,16 @@ pub fn filename_for_input(sess: &Session, crate_type: session::CrateType,
840842 } ;
841843 out_filename. with_filename ( format ! ( "{}{}{}" , prefix, libname, suffix) )
842844 }
843- session :: CrateTypeStaticlib => {
845+ config :: CrateTypeStaticlib => {
844846 out_filename. with_filename ( format ! ( "lib{}.a" , libname) )
845847 }
846- session :: CrateTypeExecutable => out_filename. clone ( ) ,
848+ config :: CrateTypeExecutable => out_filename. clone ( ) ,
847849 }
848850}
849851
850852fn link_binary_output ( sess : & Session ,
851853 trans : & CrateTranslation ,
852- crate_type : session :: CrateType ,
854+ crate_type : config :: CrateType ,
853855 outputs : & OutputFilenames ,
854856 id : & CrateId ) -> Path {
855857 let obj_filename = outputs. temp_path ( OutputTypeObject ) ;
@@ -877,16 +879,16 @@ fn link_binary_output(sess: &Session,
877879 }
878880
879881 match crate_type {
880- session :: CrateTypeRlib => {
882+ config :: CrateTypeRlib => {
881883 link_rlib ( sess, Some ( trans) , & obj_filename, & out_filename) ;
882884 }
883- session :: CrateTypeStaticlib => {
885+ config :: CrateTypeStaticlib => {
884886 link_staticlib ( sess, & obj_filename, & out_filename) ;
885887 }
886- session :: CrateTypeExecutable => {
888+ config :: CrateTypeExecutable => {
887889 link_natively ( sess, trans, false , & obj_filename, & out_filename) ;
888890 }
889- session :: CrateTypeDylib => {
891+ config :: CrateTypeDylib => {
890892 link_natively ( sess, trans, true , & obj_filename, & out_filename) ;
891893 }
892894 }
@@ -1045,7 +1047,7 @@ fn link_natively(sess: &Session, trans: &CrateTranslation, dylib: bool,
10451047 let mut cc_args = sess. targ_cfg . target_strs . cc_args . clone ( ) ;
10461048 cc_args. push_all_move ( link_args ( sess, dylib, tmpdir. path ( ) , trans,
10471049 obj_filename, out_filename) ) ;
1048- if ( sess. opts . debugging_opts & session :: PRINT_LINK_ARGS ) != 0 {
1050+ if ( sess. opts . debugging_opts & config :: PRINT_LINK_ARGS ) != 0 {
10491051 println ! ( "{} link args: '{}'" , cc_prog, cc_args. connect( "' '" ) ) ;
10501052 }
10511053
@@ -1161,8 +1163,8 @@ fn link_args(sess: &Session,
11611163
11621164 // GNU-style linkers support optimization with -O. GNU ld doesn't need a
11631165 // numeric argument, but other linkers do.
1164- if sess. opts . optimize == session :: Default ||
1165- sess. opts . optimize == session :: Aggressive {
1166+ if sess. opts . optimize == config :: Default ||
1167+ sess. opts . optimize == config :: Aggressive {
11661168 args. push ( "-Wl,-O1" . to_owned ( ) ) ;
11671169 }
11681170 } else if sess. targ_cfg . os == abi:: OsMacos {
@@ -1373,9 +1375,9 @@ fn add_upstream_rust_crates(args: &mut Vec<~str>, sess: &Session,
13731375 // involves just passing the right -l flag.
13741376
13751377 let data = if dylib {
1376- trans. crate_formats . get ( & session :: CrateTypeDylib )
1378+ trans. crate_formats . get ( & config :: CrateTypeDylib )
13771379 } else {
1378- trans. crate_formats . get ( & session :: CrateTypeExecutable )
1380+ trans. crate_formats . get ( & config :: CrateTypeExecutable )
13791381 } ;
13801382
13811383 // Invoke get_used_crates to ensure that we get a topological sorting of
@@ -1403,7 +1405,7 @@ fn add_upstream_rust_crates(args: &mut Vec<~str>, sess: &Session,
14031405 }
14041406
14051407 // Converts a library file-stem into a cc -l argument
1406- fn unlib ( config : & session :: Config , stem : & str ) -> ~str {
1408+ fn unlib ( config : & config :: Config , stem : & str ) -> ~str {
14071409 if stem. starts_with ( "lib" ) && config. os != abi:: OsWin32 {
14081410 stem. slice ( 3 , stem. len ( ) ) . to_owned ( )
14091411 } else {
0 commit comments