]> git.lizzy.rs Git - rust.git/blob - src/librustc_back/arm.rs
Add a few more derivings to AST types
[rust.git] / src / librustc_back / arm.rs
1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 use target_strs;
12 use syntax::abi;
13
14 pub fn get_target_strs(target_triple: String, target_os: abi::Os) -> target_strs::t {
15     let cc_args = if target_triple.as_slice().contains("thumb") {
16         vec!("-mthumb".to_string())
17     } else {
18         vec!("-marm".to_string())
19     };
20     return target_strs::t {
21         module_asm: "".to_string(),
22
23         data_layout: match target_os {
24           abi::OsMacos => {
25             "e-p:32:32:32\
26                 -i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
27                 -f32:32:32-f64:64:64\
28                 -v64:64:64-v128:64:128\
29                 -a0:0:64-n32".to_string()
30           }
31
32           abi::OsiOS => {
33             "e-p:32:32:32\
34                 -i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
35                 -f32:32:32-f64:64:64\
36                 -v64:64:64-v128:64:128\
37                 -a0:0:64-n32".to_string()
38           }
39
40           abi::OsWin32 => {
41             "e-p:32:32:32\
42                 -i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
43                 -f32:32:32-f64:64:64\
44                 -v64:64:64-v128:64:128\
45                 -a0:0:64-n32".to_string()
46           }
47
48           abi::OsLinux => {
49             "e-p:32:32:32\
50                 -i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
51                 -f32:32:32-f64:64:64\
52                 -v64:64:64-v128:64:128\
53                 -a0:0:64-n32".to_string()
54           }
55
56           abi::OsAndroid => {
57             "e-p:32:32:32\
58                 -i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
59                 -f32:32:32-f64:64:64\
60                 -v64:64:64-v128:64:128\
61                 -a0:0:64-n32".to_string()
62           }
63
64           abi::OsFreebsd => {
65             "e-p:32:32:32\
66                 -i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
67                 -f32:32:32-f64:64:64\
68                 -v64:64:64-v128:64:128\
69                 -a0:0:64-n32".to_string()
70           }
71         },
72
73         target_triple: target_triple,
74
75         cc_args: cc_args,
76     };
77 }