Skip to content

Commit 66593a7

Browse files
committed
auto merge of #8911 : Kimundi/rust/master, r=huonw
Most notable: span -> Span
2 parents 6178501 + 539f379 commit 66593a7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+1315
-1310
lines changed

src/librustc/back/arm.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,46 +13,46 @@ use driver::session::sess_os_to_meta_os;
1313
use driver::session;
1414
use metadata::loader::meta_section_name;
1515

16-
pub fn get_target_strs(target_triple: ~str, target_os: session::os) -> target_strs::t {
16+
pub fn get_target_strs(target_triple: ~str, target_os: session::Os) -> target_strs::t {
1717
return target_strs::t {
1818
module_asm: ~"",
1919

20-
meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)),
20+
meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)).to_owned(),
2121

2222
data_layout: match target_os {
23-
session::os_macos => {
23+
session::OsMacos => {
2424
~"e-p:32:32:32" +
2525
"-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
2626
"-f32:32:32-f64:64:64" +
2727
"-v64:64:64-v128:64:128" +
2828
"-a0:0:64-n32"
2929
}
3030

31-
session::os_win32 => {
31+
session::OsWin32 => {
3232
~"e-p:32:32:32" +
3333
"-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
3434
"-f32:32:32-f64:64:64" +
3535
"-v64:64:64-v128:64:128" +
3636
"-a0:0:64-n32"
3737
}
3838

39-
session::os_linux => {
39+
session::OsLinux => {
4040
~"e-p:32:32:32" +
4141
"-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
4242
"-f32:32:32-f64:64:64" +
4343
"-v64:64:64-v128:64:128" +
4444
"-a0:0:64-n32"
4545
}
4646

47-
session::os_android => {
47+
session::OsAndroid => {
4848
~"e-p:32:32:32" +
4949
"-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
5050
"-f32:32:32-f64:64:64" +
5151
"-v64:64:64-v128:64:128" +
5252
"-a0:0:64-n32"
5353
}
5454

55-
session::os_freebsd => {
55+
session::OsFreebsd => {
5656
~"e-p:32:32:32" +
5757
"-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
5858
"-f32:32:32-f64:64:64" +

src/librustc/back/link.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -814,13 +814,13 @@ pub fn mangle_internal_name_by_seq(_ccx: &mut CrateContext, flav: &str) -> ~str
814814
}
815815

816816

817-
pub fn output_dll_filename(os: session::os, lm: LinkMeta) -> ~str {
817+
pub fn output_dll_filename(os: session::Os, lm: LinkMeta) -> ~str {
818818
let (dll_prefix, dll_suffix) = match os {
819-
session::os_win32 => (win32::DLL_PREFIX, win32::DLL_SUFFIX),
820-
session::os_macos => (macos::DLL_PREFIX, macos::DLL_SUFFIX),
821-
session::os_linux => (linux::DLL_PREFIX, linux::DLL_SUFFIX),
822-
session::os_android => (android::DLL_PREFIX, android::DLL_SUFFIX),
823-
session::os_freebsd => (freebsd::DLL_PREFIX, freebsd::DLL_SUFFIX),
819+
session::OsWin32 => (win32::DLL_PREFIX, win32::DLL_SUFFIX),
820+
session::OsMacos => (macos::DLL_PREFIX, macos::DLL_SUFFIX),
821+
session::OsLinux => (linux::DLL_PREFIX, linux::DLL_SUFFIX),
822+
session::OsAndroid => (android::DLL_PREFIX, android::DLL_SUFFIX),
823+
session::OsFreebsd => (freebsd::DLL_PREFIX, freebsd::DLL_SUFFIX),
824824
};
825825
fmt!("%s%s-%s-%s%s", dll_prefix, lm.name, lm.extras_hash, lm.vers, dll_suffix)
826826
}
@@ -835,7 +835,7 @@ pub fn get_cc_prog(sess: Session) -> ~str {
835835
match sess.opts.linker {
836836
Some(ref linker) => linker.to_str(),
837837
None => match sess.targ_cfg.os {
838-
session::os_android =>
838+
session::OsAndroid =>
839839
match &sess.opts.android_cross_path {
840840
&Some(ref path) => {
841841
fmt!("%s/bin/arm-linux-androideabi-gcc", *path)
@@ -845,7 +845,7 @@ pub fn get_cc_prog(sess: Session) -> ~str {
845845
(--android-cross-path)")
846846
}
847847
},
848-
session::os_win32 => ~"g++",
848+
session::OsWin32 => ~"g++",
849849
_ => ~"cc"
850850
}
851851
}
@@ -892,7 +892,7 @@ pub fn link_binary(sess: Session,
892892
}
893893

894894
// Clean up on Darwin
895-
if sess.targ_cfg.os == session::os_macos {
895+
if sess.targ_cfg.os == session::OsMacos {
896896
run::process_status("dsymutil", [output.to_str()]);
897897
}
898898

@@ -913,7 +913,7 @@ pub fn link_args(sess: Session,
913913
// Converts a library file-stem into a cc -l argument
914914
fn unlib(config: @session::config, stem: ~str) -> ~str {
915915
if stem.starts_with("lib") &&
916-
config.os != session::os_win32 {
916+
config.os != session::OsWin32 {
917917
stem.slice(3, stem.len()).to_owned()
918918
} else {
919919
stem
@@ -939,7 +939,7 @@ pub fn link_args(sess: Session,
939939
obj_filename.to_str()]);
940940

941941
let lib_cmd = match sess.targ_cfg.os {
942-
session::os_macos => ~"-dynamiclib",
942+
session::OsMacos => ~"-dynamiclib",
943943
_ => ~"-shared"
944944
};
945945

@@ -995,28 +995,28 @@ pub fn link_args(sess: Session,
995995

996996
// On mac we need to tell the linker to let this library
997997
// be rpathed
998-
if sess.targ_cfg.os == session::os_macos {
998+
if sess.targ_cfg.os == session::OsMacos {
999999
args.push(~"-Wl,-install_name,@rpath/"
10001000
+ output.filename().unwrap());
10011001
}
10021002
}
10031003
10041004
// On linux librt and libdl are an indirect dependencies via rustrt,
10051005
// and binutils 2.22+ won't add them automatically
1006-
if sess.targ_cfg.os == session::os_linux {
1006+
if sess.targ_cfg.os == session::OsLinux {
10071007
args.push_all([~"-lrt", ~"-ldl"]);
10081008

10091009
// LLVM implements the `frem` instruction as a call to `fmod`,
10101010
// which lives in libm. Similar to above, on some linuxes we
10111011
// have to be explicit about linking to it. See #2510
10121012
args.push(~"-lm");
10131013
}
1014-
else if sess.targ_cfg.os == session::os_android {
1014+
else if sess.targ_cfg.os == session::OsAndroid {
10151015
args.push_all([~"-ldl", ~"-llog", ~"-lsupc++", ~"-lgnustl_shared"]);
10161016
args.push(~"-lm");
10171017
}
10181018

1019-
if sess.targ_cfg.os == session::os_freebsd {
1019+
if sess.targ_cfg.os == session::OsFreebsd {
10201020
args.push_all([~"-pthread", ~"-lrt",
10211021
~"-L/usr/local/lib", ~"-lexecinfo",
10221022
~"-L/usr/local/lib/gcc46",
@@ -1030,7 +1030,7 @@ pub fn link_args(sess: Session,
10301030
// linker from the dwarf unwind info. Unfortunately, it does not seem to
10311031
// understand how to unwind our __morestack frame, so we have to turn it
10321032
// off. This has impacted some other projects like GHC.
1033-
if sess.targ_cfg.os == session::os_macos {
1033+
if sess.targ_cfg.os == session::OsMacos {
10341034
args.push(~"-Wl,-no_compact_unwind");
10351035
}
10361036

src/librustc/back/mips.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,46 +13,46 @@ use driver::session;
1313
use driver::session::sess_os_to_meta_os;
1414
use metadata::loader::meta_section_name;
1515

16-
pub fn get_target_strs(target_triple: ~str, target_os: session::os) -> target_strs::t {
16+
pub fn get_target_strs(target_triple: ~str, target_os: session::Os) -> target_strs::t {
1717
return target_strs::t {
1818
module_asm: ~"",
1919

20-
meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)),
20+
meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)).to_owned(),
2121

2222
data_layout: match target_os {
23-
session::os_macos => {
23+
session::OsMacos => {
2424
~"e-p:32:32:32" +
2525
"-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
2626
"-f32:32:32-f64:64:64" +
2727
"-v64:64:64-v128:64:128" +
2828
"-a0:0:64-n32"
2929
}
3030

31-
session::os_win32 => {
31+
session::OsWin32 => {
3232
~"e-p:32:32:32" +
3333
"-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
3434
"-f32:32:32-f64:64:64" +
3535
"-v64:64:64-v128:64:128" +
3636
"-a0:0:64-n32"
3737
}
3838

39-
session::os_linux => {
39+
session::OsLinux => {
4040
~"e-p:32:32:32" +
4141
"-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
4242
"-f32:32:32-f64:64:64" +
4343
"-v64:64:64-v128:64:128" +
4444
"-a0:0:64-n32"
4545
}
4646

47-
session::os_android => {
47+
session::OsAndroid => {
4848
~"e-p:32:32:32" +
4949
"-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
5050
"-f32:32:32-f64:64:64" +
5151
"-v64:64:64-v128:64:128" +
5252
"-a0:0:64-n32"
5353
}
5454

55-
session::os_freebsd => {
55+
session::OsFreebsd => {
5656
~"e-p:32:32:32" +
5757
"-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
5858
"-f32:32:32-f64:64:64" +

src/librustc/back/rpath.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ use metadata::filesearch;
1616
use std::hashmap::HashSet;
1717
use std::{os, util, vec};
1818

19-
fn not_win32(os: session::os) -> bool {
20-
os != session::os_win32
19+
fn not_win32(os: session::Os) -> bool {
20+
os != session::OsWin32
2121
}
2222

2323
pub fn get_rpath_flags(sess: session::Session, out_filename: &Path)
2424
-> ~[~str] {
2525
let os = sess.targ_cfg.os;
2626

2727
// No rpath on windows
28-
if os == session::os_win32 {
28+
if os == session::OsWin32 {
2929
return ~[];
3030
}
3131

@@ -52,7 +52,7 @@ pub fn rpaths_to_flags(rpaths: &[Path]) -> ~[~str] {
5252
rpaths.iter().map(|rpath| fmt!("-Wl,-rpath,%s",rpath.to_str())).collect()
5353
}
5454

55-
fn get_rpaths(os: session::os,
55+
fn get_rpaths(os: session::Os,
5656
sysroot: &Path,
5757
output: &Path,
5858
libs: &[Path],
@@ -97,13 +97,13 @@ fn get_rpaths(os: session::os,
9797
return rpaths;
9898
}
9999

100-
fn get_rpaths_relative_to_output(os: session::os,
100+
fn get_rpaths_relative_to_output(os: session::Os,
101101
output: &Path,
102102
libs: &[Path]) -> ~[Path] {
103103
libs.iter().map(|a| get_rpath_relative_to_output(os, output, a)).collect()
104104
}
105105

106-
pub fn get_rpath_relative_to_output(os: session::os,
106+
pub fn get_rpath_relative_to_output(os: session::Os,
107107
output: &Path,
108108
lib: &Path)
109109
-> Path {
@@ -113,10 +113,10 @@ pub fn get_rpath_relative_to_output(os: session::os,
113113

114114
// Mac doesn't appear to support $ORIGIN
115115
let prefix = match os {
116-
session::os_android | session::os_linux | session::os_freebsd
116+
session::OsAndroid | session::OsLinux | session::OsFreebsd
117117
=> "$ORIGIN",
118-
session::os_macos => "@executable_path",
119-
session::os_win32 => util::unreachable()
118+
session::OsMacos => "@executable_path",
119+
session::OsWin32 => util::unreachable()
120120
};
121121

122122
Path(prefix).push_rel(&os::make_absolute(output).get_relative_to(&os::make_absolute(lib)))
@@ -205,7 +205,7 @@ mod test {
205205
#[cfg(target_os = "linux")]
206206
#[cfg(target_os = "android")]
207207
fn test_rpath_relative() {
208-
let o = session::os_linux;
208+
let o = session::OsLinux;
209209
let res = get_rpath_relative_to_output(o,
210210
&Path("bin/rustc"), &Path("lib/libstd.so"));
211211
assert_eq!(res.to_str(), ~"$ORIGIN/../lib");
@@ -214,7 +214,7 @@ mod test {
214214
#[test]
215215
#[cfg(target_os = "freebsd")]
216216
fn test_rpath_relative() {
217-
let o = session::os_freebsd;
217+
let o = session::OsFreebsd;
218218
let res = get_rpath_relative_to_output(o,
219219
&Path("bin/rustc"), &Path("lib/libstd.so"));
220220
assert_eq!(res.to_str(), ~"$ORIGIN/../lib");
@@ -223,7 +223,7 @@ mod test {
223223
#[test]
224224
#[cfg(target_os = "macos")]
225225
fn test_rpath_relative() {
226-
let o = session::os_macos;
226+
let o = session::OsMacos;
227227
let res = get_rpath_relative_to_output(o,
228228
&Path("bin/rustc"),
229229
&Path("lib/libstd.so"));

src/librustc/back/x86.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,32 @@ use driver::session::sess_os_to_meta_os;
1414
use driver::session;
1515
use metadata::loader::meta_section_name;
1616

17-
pub fn get_target_strs(target_triple: ~str, target_os: session::os) -> target_strs::t {
17+
pub fn get_target_strs(target_triple: ~str, target_os: session::Os) -> target_strs::t {
1818
return target_strs::t {
1919
module_asm: ~"",
2020

21-
meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)),
21+
meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)).to_owned(),
2222

2323
data_layout: match target_os {
24-
session::os_macos => {
24+
session::OsMacos => {
2525
~"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16" +
2626
"-i32:32:32-i64:32:64" +
2727
"-f32:32:32-f64:32:64-v64:64:64" +
2828
"-v128:128:128-a0:0:64-f80:128:128" + "-n8:16:32"
2929
}
3030

31-
session::os_win32 => {
31+
session::OsWin32 => {
3232
~"e-p:32:32-f64:64:64-i64:64:64-f80:32:32-n8:16:32"
3333
}
3434

35-
session::os_linux => {
35+
session::OsLinux => {
3636
~"e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32"
3737
}
38-
session::os_android => {
38+
session::OsAndroid => {
3939
~"e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32"
4040
}
4141

42-
session::os_freebsd => {
42+
session::OsFreebsd => {
4343
~"e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32"
4444
}
4545
},

src/librustc/back/x86_64.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,38 @@ use driver::session::sess_os_to_meta_os;
1414
use driver::session;
1515
use metadata::loader::meta_section_name;
1616

17-
pub fn get_target_strs(target_triple: ~str, target_os: session::os) -> target_strs::t {
17+
pub fn get_target_strs(target_triple: ~str, target_os: session::Os) -> target_strs::t {
1818
return target_strs::t {
1919
module_asm: ~"",
2020

21-
meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)),
21+
meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)).to_owned(),
2222

2323
data_layout: match target_os {
24-
session::os_macos => {
24+
session::OsMacos => {
2525
~"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"+
2626
"f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-"+
2727
"s0:64:64-f80:128:128-n8:16:32:64"
2828
}
2929

30-
session::os_win32 => {
30+
session::OsWin32 => {
3131
// FIXME: Test this. Copied from linux (#2398)
3232
~"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"+
3333
"f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-"+
3434
"s0:64:64-f80:128:128-n8:16:32:64-S128"
3535
}
3636

37-
session::os_linux => {
37+
session::OsLinux => {
3838
~"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"+
3939
"f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-"+
4040
"s0:64:64-f80:128:128-n8:16:32:64-S128"
4141
}
42-
session::os_android => {
42+
session::OsAndroid => {
4343
~"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"+
4444
"f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-"+
4545
"s0:64:64-f80:128:128-n8:16:32:64-S128"
4646
}
4747

48-
session::os_freebsd => {
48+
session::OsFreebsd => {
4949
~"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"+
5050
"f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-"+
5151
"s0:64:64-f80:128:128-n8:16:32:64-S128"

0 commit comments

Comments
 (0)