Skip to content

Commit d8faf20

Browse files
committed
---
yaml --- r: 277565 b: refs/heads/try c: 44b3cd8 h: refs/heads/master i: 277563: 1601754
1 parent 2eb1fc8 commit d8faf20

File tree

12 files changed

+543
-424
lines changed

12 files changed

+543
-424
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: 9355a91224a6f715b94342c074e5bac1f9e820f3
4+
refs/heads/try: 44b3cd8c462a420ab64a44ef8f70c007001a1f44
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 (we don't
45-
// explicitly request it), and on Android and DragonFly we explicitly request
46-
// it as unprefixing cause segfaults (mismatches in allocators).
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).
4747
extern {
4848
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
49-
target_os = "dragonfly"),
49+
target_os = "dragonfly", target_os = "windows"),
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"),
53+
target_os = "dragonfly", target_os = "windows"),
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"),
57+
target_os = "dragonfly", target_os = "windows"),
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"),
61+
target_os = "dragonfly", target_os = "windows"),
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"),
65+
target_os = "dragonfly", target_os = "windows"),
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: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ pub enum OptLevel {
4848
No, // -O0
4949
Less, // -O1
5050
Default, // -O2
51-
Aggressive // -O3
51+
Aggressive, // -O3
52+
Size, // -Os
53+
SizeMin, // -Oz
5254
}
5355

5456
#[derive(Clone, Copy, PartialEq)]
@@ -567,8 +569,8 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
567569
debuginfo: Option<usize> = (None, parse_opt_uint,
568570
"debug info emission level, 0 = no debug info, 1 = line tables only, \
569571
2 = full debug info with variable and type information"),
570-
opt_level: Option<usize> = (None, parse_opt_uint,
571-
"optimize with possible levels 0-3"),
572+
opt_level: Option<String> = (None, parse_opt_string,
573+
"optimize with possible levels 0-3, s, or z"),
572574
debug_assertions: Option<bool> = (None, parse_opt_bool,
573575
"explicitly enable the cfg(debug_assertions) directive"),
574576
inline_threshold: Option<usize> = (None, parse_opt_uint,
@@ -1125,13 +1127,20 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
11251127
}
11261128
OptLevel::Default
11271129
} else {
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) => {
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), _) => {
11351144
early_error(error_format, &format!("optimization level needs to be \
11361145
between 0-3 (instead was `{}`)",
11371146
arg));
@@ -1304,7 +1313,7 @@ pub mod nightly_options {
13041313
is_nightly_build() && matches.opt_strs("Z").iter().any(|x| *x == "unstable-options")
13051314
}
13061315

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

branches/try/src/librustc_llvm/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ pub use self::FileType::*;
4444
pub use self::MetadataType::*;
4545
pub use self::AsmDialect::*;
4646
pub use self::CodeGenOptLevel::*;
47+
pub use self::CodeGenOptSize::*;
4748
pub use self::RelocMode::*;
4849
pub use self::CodeGenModel::*;
4950
pub use self::DiagnosticKind::*;
@@ -375,6 +376,14 @@ pub enum CodeGenOptLevel {
375376
CodeGenLevelAggressive = 3,
376377
}
377378

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

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,9 @@ impl<'a,'tcx> Builder<'a,'tcx> {
8787
}
8888
ExprKind::Cast { source } => {
8989
let source = this.hir.mirror(source);
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-
}
90+
91+
let source = unpack!(block = this.as_operand(block, source));
92+
block.and(Rvalue::Cast(CastKind::Misc, source, expr.ty))
9693
}
9794
ExprKind::ReifyFnPointer { source } => {
9895
let source = unpack!(block = this.as_operand(block, source));

0 commit comments

Comments
 (0)