Skip to content

Commit b07d9be

Browse files
committed
---
yaml --- r: 274391 b: refs/heads/stable c: 7e1acc5 h: refs/heads/master i: 274389: febc8b2 274387: 783f555 274383: bf058f2
1 parent ca2e318 commit b07d9be

Some content is hidden

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

57 files changed

+666
-1780
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: b83454a69f9da5348e0cc232ae2e30e3d3b6555c
32+
refs/heads/stable: 7e1acc57d827f2141c425a2420f8769790abac42
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and documentation.
99

1010
Read ["Installing Rust"] from [The Book].
1111

12-
["Installing Rust"]: https://doc.rust-lang.org/book/getting-started.html#installing-rust
12+
["Installing Rust"]: https://doc.rust-lang.org/book/installing-rust.html
1313
[The Book]: https://doc.rust-lang.org/book/index.html
1414

1515
## Building from Source

branches/stable/RELEASES.md

Lines changed: 0 additions & 352 deletions
Large diffs are not rendered by default.

branches/stable/configure

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,14 @@ enable_if_not_disabled() {
334334
fi
335335
}
336336

337+
to_llvm_triple() {
338+
case $1 in
339+
i686-w64-mingw32) echo i686-pc-windows-gnu ;;
340+
x86_64-w64-mingw32) echo x86_64-pc-windows-gnu ;;
341+
*) echo $1 ;;
342+
esac
343+
}
344+
337345
to_gnu_triple() {
338346
case $1 in
339347
i686-pc-windows-gnu) echo i686-w64-mingw32 ;;
@@ -638,6 +646,12 @@ valopt_nosave host "${CFG_BUILD}" "GNUs ./configure syntax LLVM host triples"
638646
valopt_nosave target "${CFG_HOST}" "GNUs ./configure syntax LLVM target triples"
639647
valopt_nosave mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
640648

649+
# Temporarily support old triples until buildbots get updated
650+
CFG_BUILD=$(to_llvm_triple $CFG_BUILD)
651+
putvar CFG_BUILD # Yes, this creates a duplicate entry, but the last one wins.
652+
CFG_HOST=$(to_llvm_triple $CFG_HOST)
653+
CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
654+
641655
# On Windows this determines root of the subtree for target libraries.
642656
# Host runtime libs always go to 'bin'.
643657
valopt libdir "${CFG_PREFIX}/lib" "install libraries"

branches/stable/mk/cfg/powerpc64-unknown-linux-gnu.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ CFG_LIB_NAME_powerpc64-unknown-linux-gnu=lib$(1).so
88
CFG_STATIC_LIB_NAME_powerpc64-unknown-linux-gnu=lib$(1).a
99
CFG_LIB_GLOB_powerpc64-unknown-linux-gnu=lib$(1)-*.so
1010
CFG_LIB_DSYM_GLOB_powerpc64-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
11+
CFG_JEMALLOC_CFLAGS_powerpc64-unknown-linux-gnu := -m64
1112
CFG_CFLAGS_powerpc64-unknown-linux-gnu := -m64 $(CFLAGS)
1213
CFG_GCCISH_CFLAGS_powerpc64-unknown-linux-gnu := -Wall -Werror -g -fPIC -m64 $(CFLAGS)
1314
CFG_GCCISH_CXXFLAGS_powerpc64-unknown-linux-gnu := -fno-rtti $(CXXFLAGS)

branches/stable/mk/tests.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,8 +1039,6 @@ $(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
10391039
export INCLUDE := $$(CFG_MSVC_INCLUDE_PATH_$$(HOST_$(3)))
10401040
$(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
10411041
export LIB := $$(CFG_MSVC_LIB_PATH_$$(HOST_$(3)))
1042-
$(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
1043-
export MSVC_LIB := "$$(CFG_MSVC_LIB_$$(HOST_$(3)))"
10441042
$(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
10451043
$(S)src/test/run-make/%/Makefile \
10461044
$$(CSREQ$(1)_T_$(2)_H_$(3))

branches/stable/src/libcore/intrinsics.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -552,15 +552,7 @@ extern "rust-intrinsic" {
552552
pub fn discriminant_value<T>(v: &T) -> u64;
553553

554554
/// Rust's "try catch" construct which invokes the function pointer `f` with
555-
/// the data pointer `data`.
556-
///
557-
/// The third pointer is a target-specific data pointer which is filled in
558-
/// with the specifics of the exception that occurred. For examples on Unix
559-
/// platforms this is a `*mut *mut T` which is filled in by the compiler and
560-
/// on MSVC it's `*mut [usize; 2]`. For more information see the compiler's
561-
/// source as well as std's catch implementation.
562-
#[cfg(not(stage0))]
563-
pub fn try(f: fn(*mut u8), data: *mut u8, local_ptr: *mut u8) -> i32;
564-
#[cfg(stage0)]
555+
/// the data pointer `data`, returning the exception payload if an exception
556+
/// is thrown (aka the thread panics).
565557
pub fn try(f: fn(*mut u8), data: *mut u8) -> *mut u8;
566558
}

branches/stable/src/librustc_back/target/x86_64_pc_windows_msvc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use target::Target;
1313
pub fn target() -> Target {
1414
let mut base = super::windows_msvc_base::opts();
1515
base.cpu = "x86-64".to_string();
16+
base.custom_unwind_resume = true;
1617

1718
Target {
1819
llvm_target: "x86_64-pc-windows-msvc".to_string(),

branches/stable/src/librustc_llvm/archive_ro.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ impl Drop for ArchiveRO {
7979
}
8080

8181
impl<'a> Iterator for Iter<'a> {
82-
type Item = Result<Child<'a>, String>;
82+
type Item = Child<'a>;
8383

84-
fn next(&mut self) -> Option<Result<Child<'a>, String>> {
84+
fn next(&mut self) -> Option<Child<'a>> {
8585
let ptr = unsafe { ::LLVMRustArchiveIteratorNext(self.ptr) };
8686
if ptr.is_null() {
87-
::last_error().map(Err)
87+
None
8888
} else {
89-
Some(Ok(Child { ptr: ptr, _data: marker::PhantomData }))
89+
Some(Child { ptr: ptr, _data: marker::PhantomData })
9090
}
9191
}
9292
}

branches/stable/src/librustc_llvm/lib.rs

Lines changed: 15 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub use self::DiagnosticSeverity::*;
5656
pub use self::Linkage::*;
5757
pub use self::DLLStorageClassTypes::*;
5858

59-
use std::ffi::{CString, CStr};
59+
use std::ffi::CString;
6060
use std::cell::RefCell;
6161
use std::slice;
6262
use libc::{c_uint, c_ushort, uint64_t, c_int, size_t, c_char};
@@ -544,9 +544,6 @@ pub type SMDiagnosticRef = *mut SMDiagnostic_opaque;
544544
#[allow(missing_copy_implementations)]
545545
pub enum RustArchiveMember_opaque {}
546546
pub type RustArchiveMemberRef = *mut RustArchiveMember_opaque;
547-
#[allow(missing_copy_implementations)]
548-
pub enum OperandBundleDef_opaque {}
549-
pub type OperandBundleDefRef = *mut OperandBundleDef_opaque;
550547

551548
pub type DiagnosticHandler = unsafe extern "C" fn(DiagnosticInfoRef, *mut c_void);
552549
pub type InlineAsmDiagHandler = unsafe extern "C" fn(SMDiagnosticRef, *const c_void, c_uint);
@@ -1152,15 +1149,14 @@ extern {
11521149
Addr: ValueRef,
11531150
NumDests: c_uint)
11541151
-> ValueRef;
1155-
pub fn LLVMRustBuildInvoke(B: BuilderRef,
1156-
Fn: ValueRef,
1157-
Args: *const ValueRef,
1158-
NumArgs: c_uint,
1159-
Then: BasicBlockRef,
1160-
Catch: BasicBlockRef,
1161-
Bundle: OperandBundleDefRef,
1162-
Name: *const c_char)
1163-
-> ValueRef;
1152+
pub fn LLVMBuildInvoke(B: BuilderRef,
1153+
Fn: ValueRef,
1154+
Args: *const ValueRef,
1155+
NumArgs: c_uint,
1156+
Then: BasicBlockRef,
1157+
Catch: BasicBlockRef,
1158+
Name: *const c_char)
1159+
-> ValueRef;
11641160
pub fn LLVMRustBuildLandingPad(B: BuilderRef,
11651161
Ty: TypeRef,
11661162
PersFn: ValueRef,
@@ -1171,31 +1167,6 @@ extern {
11711167
pub fn LLVMBuildResume(B: BuilderRef, Exn: ValueRef) -> ValueRef;
11721168
pub fn LLVMBuildUnreachable(B: BuilderRef) -> ValueRef;
11731169

1174-
pub fn LLVMRustBuildCleanupPad(B: BuilderRef,
1175-
ParentPad: ValueRef,
1176-
ArgCnt: c_uint,
1177-
Args: *const ValueRef,
1178-
Name: *const c_char) -> ValueRef;
1179-
pub fn LLVMRustBuildCleanupRet(B: BuilderRef,
1180-
CleanupPad: ValueRef,
1181-
UnwindBB: BasicBlockRef) -> ValueRef;
1182-
pub fn LLVMRustBuildCatchPad(B: BuilderRef,
1183-
ParentPad: ValueRef,
1184-
ArgCnt: c_uint,
1185-
Args: *const ValueRef,
1186-
Name: *const c_char) -> ValueRef;
1187-
pub fn LLVMRustBuildCatchRet(B: BuilderRef,
1188-
Pad: ValueRef,
1189-
BB: BasicBlockRef) -> ValueRef;
1190-
pub fn LLVMRustBuildCatchSwitch(Builder: BuilderRef,
1191-
ParentPad: ValueRef,
1192-
BB: BasicBlockRef,
1193-
NumHandlers: c_uint,
1194-
Name: *const c_char) -> ValueRef;
1195-
pub fn LLVMRustAddHandler(CatchSwitch: ValueRef,
1196-
Handler: BasicBlockRef);
1197-
pub fn LLVMRustSetPersonalityFn(B: BuilderRef, Pers: ValueRef);
1198-
11991170
/* Add a case to the switch instruction */
12001171
pub fn LLVMAddCase(Switch: ValueRef,
12011172
OnVal: ValueRef,
@@ -1505,13 +1476,12 @@ extern {
15051476
/* Miscellaneous instructions */
15061477
pub fn LLVMBuildPhi(B: BuilderRef, Ty: TypeRef, Name: *const c_char)
15071478
-> ValueRef;
1508-
pub fn LLVMRustBuildCall(B: BuilderRef,
1509-
Fn: ValueRef,
1510-
Args: *const ValueRef,
1511-
NumArgs: c_uint,
1512-
Bundle: OperandBundleDefRef,
1513-
Name: *const c_char)
1514-
-> ValueRef;
1479+
pub fn LLVMBuildCall(B: BuilderRef,
1480+
Fn: ValueRef,
1481+
Args: *const ValueRef,
1482+
NumArgs: c_uint,
1483+
Name: *const c_char)
1484+
-> ValueRef;
15151485
pub fn LLVMBuildSelect(B: BuilderRef,
15161486
If: ValueRef,
15171487
Then: ValueRef,
@@ -2156,12 +2126,6 @@ extern {
21562126
pub fn LLVMRustSetDataLayoutFromTargetMachine(M: ModuleRef,
21572127
TM: TargetMachineRef);
21582128
pub fn LLVMRustGetModuleDataLayout(M: ModuleRef) -> TargetDataRef;
2159-
2160-
pub fn LLVMRustBuildOperandBundleDef(Name: *const c_char,
2161-
Inputs: *const ValueRef,
2162-
NumInputs: c_uint)
2163-
-> OperandBundleDefRef;
2164-
pub fn LLVMRustFreeOperandBundleDef(Bundle: OperandBundleDefRef);
21652129
}
21662130

21672131
#[cfg(have_component_x86)]
@@ -2440,48 +2404,6 @@ pub fn initialize_available_targets() {
24402404
init_pnacl();
24412405
}
24422406

2443-
pub fn last_error() -> Option<String> {
2444-
unsafe {
2445-
let cstr = LLVMRustGetLastError();
2446-
if cstr.is_null() {
2447-
None
2448-
} else {
2449-
let err = CStr::from_ptr(cstr).to_bytes();
2450-
let err = String::from_utf8_lossy(err).to_string();
2451-
libc::free(cstr as *mut _);
2452-
Some(err)
2453-
}
2454-
}
2455-
}
2456-
2457-
pub struct OperandBundleDef {
2458-
inner: OperandBundleDefRef,
2459-
}
2460-
2461-
impl OperandBundleDef {
2462-
pub fn new(name: &str, vals: &[ValueRef]) -> OperandBundleDef {
2463-
let name = CString::new(name).unwrap();
2464-
let def = unsafe {
2465-
LLVMRustBuildOperandBundleDef(name.as_ptr(),
2466-
vals.as_ptr(),
2467-
vals.len() as c_uint)
2468-
};
2469-
OperandBundleDef { inner: def }
2470-
}
2471-
2472-
pub fn raw(&self) -> OperandBundleDefRef {
2473-
self.inner
2474-
}
2475-
}
2476-
2477-
impl Drop for OperandBundleDef {
2478-
fn drop(&mut self) {
2479-
unsafe {
2480-
LLVMRustFreeOperandBundleDef(self.inner);
2481-
}
2482-
}
2483-
}
2484-
24852407
// The module containing the native LLVM dependencies, generated by the build system
24862408
// Note that this must come after the rustllvm extern declaration so that
24872409
// parts of LLVM that rustllvm depends on aren't thrown away by the linker.

branches/stable/src/librustc_metadata/loader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ pub fn note_crate_name(err: &mut DiagnosticBuilder, name: &str) {
729729
impl ArchiveMetadata {
730730
fn new(ar: ArchiveRO) -> Option<ArchiveMetadata> {
731731
let data = {
732-
let section = ar.iter().filter_map(|s| s.ok()).find(|sect| {
732+
let section = ar.iter().find(|sect| {
733733
sect.name() == Some(METADATA_FILENAME)
734734
});
735735
match section {

branches/stable/src/librustc_trans/back/archive.rs

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ impl<'a> ArchiveBuilder<'a> {
124124
}
125125
let archive = self.src_archive.as_ref().unwrap().as_ref().unwrap();
126126
let ret = archive.iter()
127-
.filter_map(|child| child.ok())
128127
.filter(is_relevant_child)
129128
.filter_map(|child| child.name())
130129
.filter(|name| !self.removals.iter().any(|x| x == name))
@@ -333,15 +332,9 @@ impl<'a> ArchiveBuilder<'a> {
333332
// We skip any files explicitly desired for skipping, and we also skip
334333
// all SYMDEF files as these are just magical placeholders which get
335334
// re-created when we make a new archive anyway.
336-
for file in archive.iter() {
337-
let file = try!(file.map_err(string_to_io_error));
338-
if !is_relevant_child(&file) {
339-
continue
340-
}
335+
for file in archive.iter().filter(is_relevant_child) {
341336
let filename = file.name().unwrap();
342-
if skip(filename) {
343-
continue
344-
}
337+
if skip(filename) { continue }
345338
let filename = Path::new(filename).file_name().unwrap()
346339
.to_str().unwrap();
347340

@@ -455,7 +448,6 @@ impl<'a> ArchiveBuilder<'a> {
455448
unsafe {
456449
if let Some(archive) = self.src_archive() {
457450
for child in archive.iter() {
458-
let child = try!(child.map_err(string_to_io_error));
459451
let child_name = match child.name() {
460452
Some(s) => s,
461453
None => continue,
@@ -483,25 +475,10 @@ impl<'a> ArchiveBuilder<'a> {
483475
strings.push(name);
484476
}
485477
Addition::Archive { archive, archive_name: _, mut skip } => {
486-
for child in archive.iter() {
487-
let child = try!(child.map_err(string_to_io_error));
488-
if !is_relevant_child(&child) {
489-
continue
490-
}
478+
for child in archive.iter().filter(is_relevant_child) {
491479
let child_name = child.name().unwrap();
492-
if skip(child_name) {
493-
continue
494-
}
495-
496-
// It appears that LLVM's archive writer is a little
497-
// buggy if the name we pass down isn't just the
498-
// filename component, so chop that off here and
499-
// pass it in.
500-
//
501-
// See LLVM bug 25877 for more info.
502-
let child_name = Path::new(child_name)
503-
.file_name().unwrap()
504-
.to_str().unwrap();
480+
if skip(child_name) { continue }
481+
505482
let name = try!(CString::new(child_name));
506483
let m = llvm::LLVMRustArchiveMemberNew(ptr::null(),
507484
name.as_ptr(),
@@ -540,7 +517,3 @@ impl<'a> ArchiveBuilder<'a> {
540517
}
541518
}
542519
}
543-
544-
fn string_to_io_error(s: String) -> io::Error {
545-
io::Error::new(io::ErrorKind::Other, format!("bad archive: {}", s))
546-
}

branches/stable/src/librustc_trans/back/lto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub fn run(sess: &session::Session, llmod: ModuleRef,
5252
link::each_linked_rlib(sess, &mut |_, path| {
5353
let archive = ArchiveRO::open(&path).expect("wanted an rlib");
5454
let bytecodes = archive.iter().filter_map(|child| {
55-
child.ok().and_then(|c| c.name().map(|name| (name, c)))
55+
child.name().map(|name| (name, child))
5656
}).filter(|&(name, _)| name.ends_with("bytecode.deflate"));
5757
for (name, data) in bytecodes {
5858
let bc_encoded = data.data();

branches/stable/src/librustc_trans/back/write.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,24 @@ use std::collections::HashMap;
2727
use std::ffi::{CStr, CString};
2828
use std::fs;
2929
use std::path::{Path, PathBuf};
30+
use std::ptr;
3031
use std::str;
3132
use std::sync::{Arc, Mutex};
3233
use std::sync::mpsc::channel;
3334
use std::thread;
34-
use libc::{c_uint, c_int, c_void};
35+
use libc::{self, c_uint, c_int, c_void};
3536

3637
pub fn llvm_err(handler: &errors::Handler, msg: String) -> ! {
37-
match llvm::last_error() {
38-
Some(err) => panic!(handler.fatal(&format!("{}: {}", msg, err))),
39-
None => panic!(handler.fatal(&msg)),
38+
unsafe {
39+
let cstr = llvm::LLVMRustGetLastError();
40+
if cstr == ptr::null() {
41+
panic!(handler.fatal(&msg[..]));
42+
} else {
43+
let err = CStr::from_ptr(cstr).to_bytes();
44+
let err = String::from_utf8_lossy(err).to_string();
45+
libc::free(cstr as *mut _);
46+
panic!(handler.fatal(&format!("{}: {}", &msg[..], &err[..])));
47+
}
4048
}
4149
}
4250

branches/stable/src/librustc_trans/trans/_match.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,8 +1271,7 @@ fn compile_submatch_continue<'a, 'p, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
12711271
};
12721272
}
12731273
Variant(_, ref repr, _, _) => {
1274-
let (the_kind, val_opt) = adt::trans_switch(bcx, &repr,
1275-
val.val, true);
1274+
let (the_kind, val_opt) = adt::trans_switch(bcx, &**repr, val.val);
12761275
kind = the_kind;
12771276
if let Some(tval) = val_opt { test_val = tval; }
12781277
}

0 commit comments

Comments
 (0)