Skip to content

Commit b5e2d3a

Browse files
committed
---
yaml --- r: 273761 b: refs/heads/beta c: e9b1c3c h: refs/heads/master i: 273759: e571164
1 parent 8d24ac9 commit b5e2d3a

File tree

31 files changed

+86
-280
lines changed

31 files changed

+86
-280
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 9f403abba28b3a36dcaae197b294105004e32a55
26+
refs/heads/beta: e9b1c3ccb5fbae3d61d4ba0c1d650763dcda3923
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ $ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake
12521252
bits=x86_64
12531253
msvc_part=amd64
12541254
;;
1255-
i*86-*)
1255+
i686-*)
12561256
bits=i386
12571257
msvc_part=
12581258
;;

branches/beta/mk/crates.mk

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,11 @@ TARGET_CRATES := libc std term \
5353
getopts collections test rand \
5454
core alloc \
5555
rustc_unicode rustc_bitflags \
56-
alloc_system alloc_jemalloc
56+
alloc_system alloc_jemalloc rustc_const_eval
5757
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
5959
rustc_data_structures rustc_front rustc_platform_intrinsics \
60-
rustc_plugin rustc_metadata rustc_passes rustc_save_analysis \
61-
rustc_const_eval
60+
rustc_plugin rustc_metadata rustc_passes rustc_save_analysis
6261
HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros \
6362
flate arena graphviz rbml log serialize
6463
TOOLS := compiletest rustdoc rustc rustbook error_index_generator
@@ -95,9 +94,9 @@ DEPS_syntax_ext := syntax fmt_macros
9594
DEPS_rustc_const_eval := std syntax
9695

9796
DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml rustc_front\
98-
log graphviz rustc_back rustc_data_structures\
97+
log graphviz rustc_llvm rustc_back rustc_data_structures\
9998
rustc_const_eval
100-
DEPS_rustc_back := std syntax rustc_front flate log libc
99+
DEPS_rustc_back := std syntax rustc_llvm rustc_front flate log libc
101100
DEPS_rustc_borrowck := rustc rustc_front rustc_mir log graphviz syntax
102101
DEPS_rustc_data_structures := std log serialize
103102
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
@@ -111,7 +110,7 @@ DEPS_rustc_metadata := rustc rustc_front syntax rbml rustc_const_eval
111110
DEPS_rustc_passes := syntax rustc core rustc_front
112111
DEPS_rustc_mir := rustc rustc_front syntax rustc_const_eval
113112
DEPS_rustc_resolve := arena rustc rustc_front log syntax
114-
DEPS_rustc_platform_intrinsics := std
113+
DEPS_rustc_platform_intrinsics := rustc rustc_llvm
115114
DEPS_rustc_plugin := rustc rustc_metadata syntax rustc_mir
116115
DEPS_rustc_privacy := rustc rustc_front log syntax
117116
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \

branches/beta/mk/main.mk

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ endif
493493
LD_LIBRARY_PATH_ENV_HOSTDIR$(1)_T_$(2)_H_$(3) := \
494494
$$(CURDIR)/$$(HLIB$(1)_H_$(3)):$$(CFG_LLVM_INST_DIR_$(3))/lib
495495
LD_LIBRARY_PATH_ENV_TARGETDIR$(1)_T_$(2)_H_$(3) := \
496-
$$(CURDIR)/$$(TLIB$(1)_T_$(2)_H_$(3))
496+
$$(CURDIR)/$$(TLIB$(1)_T_$(2)_H_$(CFG_BUILD))
497497

498498
HOST_RPATH_VAR$(1)_T_$(2)_H_$(3) := \
499499
$$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3))=$$(LD_LIBRARY_PATH_ENV_HOSTDIR$(1)_T_$(2)_H_$(3)):$$$$$$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3))
@@ -506,14 +506,18 @@ RPATH_VAR$(1)_T_$(2)_H_$(3) := $$(HOST_RPATH_VAR$(1)_T_$(2)_H_$(3))
506506
# if you're building a cross config, the host->* parts are
507507
# effectively stage1, since it uses the just-built stage0.
508508
#
509-
# Also be sure to use the right rpath because we're loading libraries from the
510-
# CFG_BUILD's stage1 directory for our target, so switch this one instance of
511-
# `RPATH_VAR` to get the bootstrap working.
509+
# This logic is similar to how the LD_LIBRARY_PATH variable must
510+
# change be slightly different when doing cross compilations.
511+
# The build doesn't copy over all target libraries into
512+
# a new directory, so we need to point the library path at
513+
# the build directory where all the target libraries came
514+
# from (the stage0 build host). Otherwise the relative rpaths
515+
# inside of the rustc binary won't get resolved correctly.
512516
ifeq ($(1),0)
513517
ifneq ($(strip $(CFG_BUILD)),$(strip $(3)))
514518
CFGFLAG$(1)_T_$(2)_H_$(3) = stage1
515519

516-
RPATH_VAR$(1)_T_$(2)_H_$(3) := $$(TARGET_RPATH_VAR1_T_$(2)_H_$$(CFG_BUILD))
520+
RPATH_VAR$(1)_T_$(2)_H_$(3) := $$(TARGET_RPATH_VAR$(1)_T_$(2)_H_$(3))
517521
endif
518522
endif
519523

branches/beta/mk/rt.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,11 @@ COMPRT_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(COMPRT_NAME_$(1))
236236
COMPRT_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/compiler-rt
237237

238238
ifeq ($$(findstring msvc,$(1)),msvc)
239-
$$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS) $$(LLVM_CONFIG_$$(CFG_BUILD))
239+
$$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS) $$(LLVM_CONFIG_$(1))
240240
@$$(call E, cmake: compiler-rt)
241241
$$(Q)cd "$$(COMPRT_BUILD_DIR_$(1))"; $$(CFG_CMAKE) "$(S)src/compiler-rt" \
242242
-DCMAKE_BUILD_TYPE=$$(LLVM_BUILD_CONFIG_MODE) \
243-
-DLLVM_CONFIG_PATH=$$(LLVM_CONFIG_$$(CFG_BUILD)) \
243+
-DLLVM_CONFIG_PATH=$$(LLVM_CONFIG_$(1)) \
244244
-G"$$(CFG_CMAKE_GENERATOR)"
245245
$$(Q)$$(CFG_CMAKE) --build "$$(COMPRT_BUILD_DIR_$(1))" \
246246
--target lib/builtins/builtins \

branches/beta/src/doc/book/no-stdlib.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn start(_argc: isize, _argv: *const *const u8) -> isize {
3838
// for a bare-bones hello world. These are normally
3939
// provided by libstd.
4040
#[lang = "eh_personality"] extern fn eh_personality() {}
41-
#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} }
41+
#[lang = "panic_fmt"] extern fn panic_fmt() -> ! { loop {} }
4242
# #[lang = "eh_unwind_resume"] extern fn rust_eh_unwind_resume() {}
4343
# #[no_mangle] pub extern fn rust_eh_register_frames () {}
4444
# #[no_mangle] pub extern fn rust_eh_unregister_frames () {}
@@ -65,7 +65,7 @@ pub extern fn main(argc: i32, argv: *const *const u8) -> i32 {
6565
}
6666

6767
#[lang = "eh_personality"] extern fn eh_personality() {}
68-
#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} }
68+
#[lang = "panic_fmt"] extern fn panic_fmt() -> ! { loop {} }
6969
# #[lang = "eh_unwind_resume"] extern fn rust_eh_unwind_resume() {}
7070
# #[no_mangle] pub extern fn rust_eh_register_frames () {}
7171
# #[no_mangle] pub extern fn rust_eh_unregister_frames () {}

branches/beta/src/etc/platform-intrinsics/generator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,11 +759,12 @@ def open(self, platform):
759759
760760
use {{Intrinsic, Type}};
761761
use IntrinsicDef::Named;
762+
use rustc::middle::ty::TyCtxt;
762763
763764
// The default inlining settings trigger a pathological behaviour in
764765
// LLVM, which causes makes compilation very slow. See #28273.
765766
#[inline(never)]
766-
pub fn find(name: &str) -> Option<Intrinsic> {{
767+
pub fn find<'tcx>(_tcx: &TyCtxt<'tcx>, name: &str) -> Option<Intrinsic> {{
767768
if !name.starts_with("{0}") {{ return None }}
768769
Some(match &name["{0}".len()..] {{'''.format(platform.intrinsic_prefix())
769770

branches/beta/src/libcore/convert.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
//!
2020
//! - Impl the `As*` traits for reference-to-reference conversions
2121
//! - Impl the `Into` trait when you want to consume the value in the conversion
22-
//! - The `From` trait is the most flexible, useful for value _and_ reference conversions
22+
//! - The `From` trait is the most flexible, useful for values _and_ references conversions
2323
//!
24-
//! As a library author, you should prefer implementing `From<T>` rather than
25-
//! `Into<U>`, as `From` provides greater flexibility and offers an equivalent `Into`
24+
//! As a library writer, you should prefer implementing `From<T>` rather than
25+
//! `Into<U>`, as `From` provides greater flexibility and offer the equivalent `Into`
2626
//! implementation for free, thanks to a blanket implementation in the standard library.
2727
//!
2828
//! **Note: these traits must not fail**. If the conversion can fail, you must use a dedicated
29-
//! method which returns an `Option<T>` or a `Result<T, E>`.
29+
//! method which return an `Option<T>` or a `Result<T, E>`.
3030
//!
3131
//! # Generic impl
3232
//!
@@ -49,7 +49,7 @@ use marker::Sized;
4949
/// [book]: ../../book/borrow-and-asref.html
5050
///
5151
/// **Note: this trait must not fail**. If the conversion can fail, use a dedicated method which
52-
/// returns an `Option<T>` or a `Result<T, E>`.
52+
/// return an `Option<T>` or a `Result<T, E>`.
5353
///
5454
/// # Examples
5555
///
@@ -82,7 +82,7 @@ pub trait AsRef<T: ?Sized> {
8282
/// A cheap, mutable reference-to-mutable reference conversion.
8383
///
8484
/// **Note: this trait must not fail**. If the conversion can fail, use a dedicated method which
85-
/// returns an `Option<T>` or a `Result<T, E>`.
85+
/// return an `Option<T>` or a `Result<T, E>`.
8686
///
8787
/// # Generic Impls
8888
///
@@ -99,10 +99,10 @@ pub trait AsMut<T: ?Sized> {
9999
/// A conversion that consumes `self`, which may or may not be expensive.
100100
///
101101
/// **Note: this trait must not fail**. If the conversion can fail, use a dedicated method which
102-
/// returns an `Option<T>` or a `Result<T, E>`.
102+
/// return an `Option<T>` or a `Result<T, E>`.
103103
///
104-
/// Library authors should not directly implement this trait, but should prefer implementing
105-
/// the `From` trait, which offers greater flexibility and provides an equivalent `Into`
104+
/// Library writer should not implement directly this trait, but should prefer the implementation
105+
/// of the `From` trait, which offer greater flexibility and provide the equivalent `Into`
106106
/// implementation for free, thanks to a blanket implementation in the standard library.
107107
///
108108
/// # Examples
@@ -134,7 +134,7 @@ pub trait Into<T>: Sized {
134134
/// Construct `Self` via a conversion.
135135
///
136136
/// **Note: this trait must not fail**. If the conversion can fail, use a dedicated method which
137-
/// returns an `Option<T>` or a `Result<T, E>`.
137+
/// return an `Option<T>` or a `Result<T, E>`.
138138
///
139139
/// # Examples
140140
///

branches/beta/src/libcore/ptr.rs

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,6 @@ pub unsafe fn write_volatile<T>(dst: *mut T, src: T) {
212212
#[lang = "const_ptr"]
213213
impl<T: ?Sized> *const T {
214214
/// Returns true if the pointer is null.
215-
///
216-
/// # Examples
217-
///
218-
/// Basic usage:
219-
///
220-
/// ```
221-
/// let s: &str = "Follow the rabbit";
222-
/// let ptr: *const u8 = s.as_ptr();
223-
/// assert!(ptr.is_null() == false);
224-
/// ```
225215
#[stable(feature = "rust1", since = "1.0.0")]
226216
#[inline]
227217
pub fn is_null(self) -> bool where T: Sized {
@@ -237,20 +227,6 @@ impl<T: ?Sized> *const T {
237227
/// null-safety, it is important to note that this is still an unsafe
238228
/// operation because the returned value could be pointing to invalid
239229
/// memory.
240-
///
241-
/// # Examples
242-
///
243-
/// Basic usage:
244-
///
245-
/// ```ignore
246-
/// let val: *const u8 = &10u8 as *const u8;
247-
///
248-
/// unsafe {
249-
/// if let Some(val_back) = val.as_ref() {
250-
/// println!("We got back the value: {}!", val_back);
251-
/// }
252-
/// }
253-
/// ```
254230
#[unstable(feature = "ptr_as_ref",
255231
reason = "Option is not clearly the right return type, and we \
256232
may want to tie the return lifetime to a borrow of \
@@ -274,20 +250,6 @@ impl<T: ?Sized> *const T {
274250
/// byte past the end of an allocated object. If either pointer is out of
275251
/// bounds or arithmetic overflow occurs then
276252
/// any further use of the returned value will result in undefined behavior.
277-
///
278-
/// # Examples
279-
///
280-
/// Basic usage:
281-
///
282-
/// ```
283-
/// let s: &str = "123";
284-
/// let ptr: *const u8 = s.as_ptr();
285-
///
286-
/// unsafe {
287-
/// println!("{}", *ptr.offset(1) as char);
288-
/// println!("{}", *ptr.offset(2) as char);
289-
/// }
290-
/// ```
291253
#[stable(feature = "rust1", since = "1.0.0")]
292254
#[inline]
293255
pub unsafe fn offset(self, count: isize) -> *const T where T: Sized {
@@ -298,16 +260,6 @@ impl<T: ?Sized> *const T {
298260
#[lang = "mut_ptr"]
299261
impl<T: ?Sized> *mut T {
300262
/// Returns true if the pointer is null.
301-
///
302-
/// # Examples
303-
///
304-
/// Basic usage:
305-
///
306-
/// ```
307-
/// let mut s = [1, 2, 3];
308-
/// let ptr: *mut u32 = s.as_mut_ptr();
309-
/// assert!(ptr.is_null() == false);
310-
/// ```
311263
#[stable(feature = "rust1", since = "1.0.0")]
312264
#[inline]
313265
pub fn is_null(self) -> bool where T: Sized {
@@ -323,20 +275,6 @@ impl<T: ?Sized> *mut T {
323275
/// null-safety, it is important to note that this is still an unsafe
324276
/// operation because the returned value could be pointing to invalid
325277
/// memory.
326-
///
327-
/// # Examples
328-
///
329-
/// Basic usage:
330-
///
331-
/// ```ignore
332-
/// let val: *mut u8 = &mut 10u8 as *mut u8;
333-
///
334-
/// unsafe {
335-
/// if let Some(val_back) = val.as_ref() {
336-
/// println!("We got back the value: {}!", val_back);
337-
/// }
338-
/// }
339-
/// ```
340278
#[unstable(feature = "ptr_as_ref",
341279
reason = "Option is not clearly the right return type, and we \
342280
may want to tie the return lifetime to a borrow of \
@@ -359,20 +297,6 @@ impl<T: ?Sized> *mut T {
359297
/// The offset must be in-bounds of the object, or one-byte-past-the-end.
360298
/// Otherwise `offset` invokes Undefined Behavior, regardless of whether
361299
/// the pointer is used.
362-
///
363-
/// # Examples
364-
///
365-
/// Basic usage:
366-
///
367-
/// ```
368-
/// let mut s = [1, 2, 3];
369-
/// let ptr: *mut u32 = s.as_mut_ptr();
370-
///
371-
/// unsafe {
372-
/// println!("{}", *ptr.offset(1));
373-
/// println!("{}", *ptr.offset(2));
374-
/// }
375-
/// ```
376300
#[stable(feature = "rust1", since = "1.0.0")]
377301
#[inline]
378302
pub unsafe fn offset(self, count: isize) -> *mut T where T: Sized {
@@ -386,15 +310,6 @@ impl<T: ?Sized> *mut T {
386310
///
387311
/// As with `as_ref`, this is unsafe because it cannot verify the validity
388312
/// of the returned pointer.
389-
///
390-
/// # Examples
391-
///
392-
/// Basic usage:
393-
///
394-
/// ```
395-
/// let mut s = [1, 2, 3];
396-
/// let ptr: *mut u32 = s.as_mut_ptr();
397-
/// ```
398313
#[unstable(feature = "ptr_as_ref",
399314
reason = "return value does not necessarily convey all possible \
400315
information",

branches/beta/src/librustc/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ rustc_bitflags = { path = "../librustc_bitflags" }
2121
rustc_const_eval = { path = "../librustc_const_eval" }
2222
rustc_data_structures = { path = "../librustc_data_structures" }
2323
rustc_front = { path = "../librustc_front" }
24+
rustc_llvm = { path = "../librustc_llvm" }
2425
serialize = { path = "../libserialize" }
2526
syntax = { path = "../libsyntax" }

branches/beta/src/librustc/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ extern crate getopts;
5050
extern crate graphviz;
5151
extern crate libc;
5252
extern crate rbml;
53+
pub extern crate rustc_llvm as llvm;
5354
extern crate rustc_back;
5455
extern crate rustc_front;
5556
extern crate rustc_data_structures;
@@ -139,6 +140,10 @@ pub mod util {
139140
pub mod fs;
140141
}
141142

143+
pub mod lib {
144+
pub use llvm;
145+
}
146+
142147
// A private module so that macro-expanded idents like
143148
// `::rustc::lint::Lint` will also work in `rustc` itself.
144149
//

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ use std::env;
3838
use std::fmt;
3939
use std::path::PathBuf;
4040

41+
use llvm;
42+
4143
pub struct Config {
4244
pub target: Target,
4345
pub int_type: IntTy,
@@ -1050,6 +1052,10 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
10501052
let dump_dep_graph = debugging_opts.dump_dep_graph;
10511053
let no_analysis = debugging_opts.no_analysis;
10521054

1055+
if debugging_opts.debug_llvm {
1056+
unsafe { llvm::LLVMSetDebug(1); }
1057+
}
1058+
10531059
let mut output_types = HashMap::new();
10541060
if !debugging_opts.parse_only && !no_trans {
10551061
for list in matches.opt_strs("emit") {

branches/beta/src/librustc_back/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ crate-type = ["dylib"]
1111
[dependencies]
1212
syntax = { path = "../libsyntax" }
1313
serialize = { path = "../libserialize" }
14+
rustc_llvm = { path = "../librustc_llvm" }
1415
rustc_front = { path = "../librustc_front" }
1516
log = { path = "../liblog" }
1617

branches/beta/src/librustc_back/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
extern crate syntax;
4646
extern crate libc;
4747
extern crate serialize;
48+
extern crate rustc_llvm;
4849
extern crate rustc_front;
4950
#[macro_use] extern crate log;
5051

branches/beta/src/librustc_driver/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,6 @@ pub fn run_compiler<'a>(args: &[String],
166166

167167
let sopts = config::build_session_options(&matches);
168168

169-
if sopts.debugging_opts.debug_llvm {
170-
unsafe { llvm::LLVMSetDebug(1); }
171-
}
172-
173169
let descriptions = diagnostics_registry();
174170

175171
do_or_return!(callbacks.early_callback(&matches,

0 commit comments

Comments
 (0)