Skip to content

Commit 731892b

Browse files
committed
---
yaml --- r: 277525 b: refs/heads/try c: a20ee76 h: refs/heads/master i: 277523: f2f442c
1 parent c023582 commit 731892b

File tree

15 files changed

+1852
-678
lines changed

15 files changed

+1852
-678
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: 9a003b0ef22090e8be5b2705a427d6b08b06eaf9
4+
refs/heads/try: a20ee76b56c46a593238ce7ac9b9f70a99c43ff4
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/liballoc_jemalloc/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,28 @@ use libc::{c_int, c_void, size_t};
4141
#[cfg(not(cargobuild))]
4242
extern {}
4343

44-
// Note that the symbols here are prefixed by default on OSX and Windows (we
45-
// don't explicitly request it), and on Android and DragonFly we explicitly
46-
// request it as unprefixing cause segfaults (mismatches in allocators).
44+
// Note that the symbols here are prefixed by default on OSX (we don't
45+
// explicitly request it), and on Android and DragonFly we explicitly request
46+
// it as unprefixing cause segfaults (mismatches in allocators).
4747
extern {
4848
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
49-
target_os = "dragonfly", target_os = "windows"),
49+
target_os = "dragonfly"),
5050
link_name = "je_mallocx")]
5151
fn mallocx(size: size_t, flags: c_int) -> *mut c_void;
5252
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
53-
target_os = "dragonfly", target_os = "windows"),
53+
target_os = "dragonfly"),
5454
link_name = "je_rallocx")]
5555
fn rallocx(ptr: *mut c_void, size: size_t, flags: c_int) -> *mut c_void;
5656
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
57-
target_os = "dragonfly", target_os = "windows"),
57+
target_os = "dragonfly"),
5858
link_name = "je_xallocx")]
5959
fn xallocx(ptr: *mut c_void, size: size_t, extra: size_t, flags: c_int) -> size_t;
6060
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
61-
target_os = "dragonfly", target_os = "windows"),
61+
target_os = "dragonfly"),
6262
link_name = "je_sdallocx")]
6363
fn sdallocx(ptr: *mut c_void, size: size_t, flags: c_int);
6464
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
65-
target_os = "dragonfly", target_os = "windows"),
65+
target_os = "dragonfly"),
6666
link_name = "je_nallocx")]
6767
fn nallocx(size: size_t, flags: c_int) -> size_t;
6868
}

branches/try/src/librustc/session/config.rs

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ pub enum OptLevel {
4848
No, // -O0
4949
Less, // -O1
5050
Default, // -O2
51-
Aggressive, // -O3
52-
Size, // -Os
53-
SizeMin, // -Oz
51+
Aggressive // -O3
5452
}
5553

5654
#[derive(Clone, Copy, PartialEq)]
@@ -569,8 +567,8 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
569567
debuginfo: Option<usize> = (None, parse_opt_uint,
570568
"debug info emission level, 0 = no debug info, 1 = line tables only, \
571569
2 = full debug info with variable and type information"),
572-
opt_level: Option<String> = (None, parse_opt_string,
573-
"optimize with possible levels 0-3, s, or z"),
570+
opt_level: Option<usize> = (None, parse_opt_uint,
571+
"optimize with possible levels 0-3"),
574572
debug_assertions: Option<bool> = (None, parse_opt_bool,
575573
"explicitly enable the cfg(debug_assertions) directive"),
576574
inline_threshold: Option<usize> = (None, parse_opt_uint,
@@ -1127,20 +1125,13 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
11271125
}
11281126
OptLevel::Default
11291127
} else {
1130-
match (cg.opt_level.as_ref().map(String::as_ref),
1131-
nightly_options::is_nightly_build()) {
1132-
(None, _) => OptLevel::No,
1133-
(Some("0"), _) => OptLevel::No,
1134-
(Some("1"), _) => OptLevel::Less,
1135-
(Some("2"), _) => OptLevel::Default,
1136-
(Some("3"), _) => OptLevel::Aggressive,
1137-
(Some("s"), true) => OptLevel::Size,
1138-
(Some("z"), true) => OptLevel::SizeMin,
1139-
(Some("s"), false) | (Some("z"), false) => {
1140-
early_error(error_format, &format!("the optimizations s or z are only \
1141-
accepted on the nightly compiler"));
1142-
},
1143-
(Some(arg), _) => {
1128+
match cg.opt_level {
1129+
None => OptLevel::No,
1130+
Some(0) => OptLevel::No,
1131+
Some(1) => OptLevel::Less,
1132+
Some(2) => OptLevel::Default,
1133+
Some(3) => OptLevel::Aggressive,
1134+
Some(arg) => {
11441135
early_error(error_format, &format!("optimization level needs to be \
11451136
between 0-3 (instead was `{}`)",
11461137
arg));
@@ -1313,7 +1304,7 @@ pub mod nightly_options {
13131304
is_nightly_build() && matches.opt_strs("Z").iter().any(|x| *x == "unstable-options")
13141305
}
13151306

1316-
pub fn is_nightly_build() -> bool {
1307+
fn is_nightly_build() -> bool {
13171308
match get_unstable_features_setting() {
13181309
UnstableFeatures::Allow | UnstableFeatures::Cheat => true,
13191310
_ => false,

branches/try/src/librustc_llvm/lib.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ pub use self::FileType::*;
4444
pub use self::MetadataType::*;
4545
pub use self::AsmDialect::*;
4646
pub use self::CodeGenOptLevel::*;
47-
pub use self::CodeGenOptSize::*;
4847
pub use self::RelocMode::*;
4948
pub use self::CodeGenModel::*;
5049
pub use self::DiagnosticKind::*;
@@ -376,14 +375,6 @@ pub enum CodeGenOptLevel {
376375
CodeGenLevelAggressive = 3,
377376
}
378377

379-
#[derive(Copy, Clone, PartialEq)]
380-
#[repr(C)]
381-
pub enum CodeGenOptSize {
382-
CodeGenOptSizeNone = 0,
383-
CodeGenOptSizeDefault = 1,
384-
CodeGenOptSizeAggressive = 2,
385-
}
386-
387378
#[derive(Copy, Clone, PartialEq)]
388379
#[repr(C)]
389380
pub enum RelocMode {

branches/try/src/librustc_mir/build/expr/as_rvalue.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,12 @@ impl<'a,'tcx> Builder<'a,'tcx> {
8787
}
8888
ExprKind::Cast { source } => {
8989
let source = this.hir.mirror(source);
90-
91-
let source = unpack!(block = this.as_operand(block, source));
92-
block.and(Rvalue::Cast(CastKind::Misc, source, expr.ty))
90+
if source.ty == expr.ty {
91+
this.expr_as_rvalue(block, source)
92+
} else {
93+
let source = unpack!(block = this.as_operand(block, source));
94+
block.and(Rvalue::Cast(CastKind::Misc, source, expr.ty))
95+
}
9396
}
9497
ExprKind::ReifyFnPointer { source } => {
9598
let source = unpack!(block = this.as_operand(block, source));

0 commit comments

Comments
 (0)