@@ -33,6 +33,7 @@ use std::getopts::groups::{optopt, optmulti, optflag, optflagopt, getopts};
3333use std:: getopts:: { opt_present} ;
3434use std:: getopts;
3535use syntax:: ast;
36+ use syntax:: abi;
3637use syntax:: attr;
3738use syntax:: codemap;
3839use syntax:: diagnostic;
@@ -85,10 +86,10 @@ pub fn default_configuration(sess: Session, +argv0: ~str, input: input) ->
8586 // ARM is bi-endian, however using NDK seems to default
8687 // to little-endian unless a flag is provided.
8788 let ( end, arch, wordsz) = match sess. targ_cfg . arch {
88- session :: arch_x86 => ( ~"little", ~"x86", ~"32 ") ,
89- session :: arch_x86_64 => ( ~"little", ~"x86_64", ~"64 ") ,
90- session :: arch_arm => ( ~"little", ~"arm", ~"32 ") ,
91- session :: arch_mips => ( ~"little", ~"arm", ~"32 ")
89+ abi :: X86 => ( ~"little", ~"x86", ~"32 ") ,
90+ abi :: X86_64 => ( ~"little", ~"x86_64", ~"64 ") ,
91+ abi :: Arm => ( ~"little", ~"arm", ~"32 ") ,
92+ abi :: Mips => ( ~"little", ~"arm", ~"32 ")
9293 } ;
9394
9495 return ~[ // Target bindings.
@@ -308,7 +309,7 @@ pub fn compile_rest(sess: Session, cfg: ast::crate_cfg,
308309 } ;
309310
310311 // NOTE: Android hack
311- if sess. targ_cfg . arch == session :: arch_arm &&
312+ if sess. targ_cfg . arch == abi :: Arm &&
312313 ( sess. opts . output_type == link:: output_type_object ||
313314 sess. opts . output_type == link:: output_type_exe) {
314315 let output_type = link:: output_type_assembly;
@@ -453,20 +454,20 @@ pub fn get_os(triple: &str) -> Option<session::os> {
453454 } else { None }
454455}
455456
456- pub fn get_arch( triple: & str) -> Option < session :: arch > {
457+ pub fn get_arch( triple: & str) -> Option < abi :: Architecture > {
457458 if str:: contains( triple, ~"i386") ||
458459 str:: contains( triple, ~"i486") ||
459460 str:: contains( triple, ~"i586") ||
460461 str:: contains( triple, ~"i686") ||
461462 str:: contains( triple, ~"i786") {
462- Some ( session :: arch_x86 )
463+ Some ( abi :: X86 )
463464 } else if str:: contains ( triple, ~"x86_64") {
464- Some ( session :: arch_x86_64 )
465+ Some ( abi :: X86_64 )
465466 } else if str:: contains ( triple, ~"arm") ||
466467 str:: contains ( triple, ~"xscale") {
467- Some ( session :: arch_arm )
468+ Some ( abi :: Arm )
468469 } else if str:: contains ( triple, ~"mips") {
469- Some ( session :: arch_mips )
470+ Some ( abi :: Mips )
470471 } else { None }
471472}
472473
@@ -483,16 +484,16 @@ pub fn build_target_config(sopts: @session::options,
483484 ~"unknown architecture: " + sopts.target_triple)
484485 };
485486 let (int_type, uint_type, float_type) = match arch {
486- session::arch_x86 => (ast::ty_i32, ast::ty_u32, ast::ty_f64),
487- session::arch_x86_64 => (ast::ty_i64, ast::ty_u64, ast::ty_f64),
488- session::arch_arm => (ast::ty_i32, ast::ty_u32, ast::ty_f64),
489- session::arch_mips => (ast::ty_i32, ast::ty_u32, ast::ty_f64)
487+ abi::X86 => (ast::ty_i32, ast::ty_u32, ast::ty_f64),
488+ abi::X86_64 => (ast::ty_i64, ast::ty_u64, ast::ty_f64),
489+ abi::Arm => (ast::ty_i32, ast::ty_u32, ast::ty_f64),
490+ abi::Mips => (ast::ty_i32, ast::ty_u32, ast::ty_f64)
490491 };
491492 let target_strs = match arch {
492- session::arch_x86 => x86::get_target_strs(os),
493- session::arch_x86_64 => x86_64::get_target_strs(os),
494- session::arch_arm => arm::get_target_strs(os),
495- session::arch_mips => mips::get_target_strs(os)
493+ abi::X86 => x86::get_target_strs(os),
494+ abi::X86_64 => x86_64::get_target_strs(os),
495+ abi::Arm => arm::get_target_strs(os),
496+ abi::Mips => mips::get_target_strs(os)
496497 };
497498 let target_cfg = @session::config {
498499 os: os,
0 commit comments