@@ -33,6 +33,7 @@ use std::getopts::groups::{optopt, optmulti, optflag, optflagopt, getopts};
33
33
use std:: getopts:: { opt_present} ;
34
34
use std:: getopts;
35
35
use syntax:: ast;
36
+ use syntax:: abi;
36
37
use syntax:: attr;
37
38
use syntax:: codemap;
38
39
use syntax:: diagnostic;
@@ -85,10 +86,10 @@ pub fn default_configuration(sess: Session, +argv0: ~str, input: input) ->
85
86
// ARM is bi-endian, however using NDK seems to default
86
87
// to little-endian unless a flag is provided.
87
88
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 ")
92
93
} ;
93
94
94
95
return ~[ // Target bindings.
@@ -308,7 +309,7 @@ pub fn compile_rest(sess: Session, cfg: ast::crate_cfg,
308
309
} ;
309
310
310
311
// NOTE: Android hack
311
- if sess. targ_cfg . arch == session :: arch_arm &&
312
+ if sess. targ_cfg . arch == abi :: Arm &&
312
313
( sess. opts . output_type == link:: output_type_object ||
313
314
sess. opts . output_type == link:: output_type_exe) {
314
315
let output_type = link:: output_type_assembly;
@@ -453,20 +454,20 @@ pub fn get_os(triple: &str) -> Option<session::os> {
453
454
} else { None }
454
455
}
455
456
456
- pub fn get_arch( triple: & str) -> Option < session :: arch > {
457
+ pub fn get_arch( triple: & str) -> Option < abi :: Architecture > {
457
458
if str:: contains( triple, ~"i386") ||
458
459
str:: contains( triple, ~"i486") ||
459
460
str:: contains( triple, ~"i586") ||
460
461
str:: contains( triple, ~"i686") ||
461
462
str:: contains( triple, ~"i786") {
462
- Some ( session :: arch_x86 )
463
+ Some ( abi :: X86 )
463
464
} else if str:: contains ( triple, ~"x86_64") {
464
- Some ( session :: arch_x86_64 )
465
+ Some ( abi :: X86_64 )
465
466
} else if str:: contains ( triple, ~"arm") ||
466
467
str:: contains ( triple, ~"xscale") {
467
- Some ( session :: arch_arm )
468
+ Some ( abi :: Arm )
468
469
} else if str:: contains ( triple, ~"mips") {
469
- Some ( session :: arch_mips )
470
+ Some ( abi :: Mips )
470
471
} else { None }
471
472
}
472
473
@@ -483,16 +484,16 @@ pub fn build_target_config(sopts: @session::options,
483
484
~"unknown architecture: " + sopts.target_triple)
484
485
};
485
486
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)
490
491
};
491
492
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)
496
497
};
497
498
let target_cfg = @session::config {
498
499
os: os,
0 commit comments