Skip to content

Commit febc8b2

Browse files
author
Andrew Barchuk
committed
---
yaml --- r: 274389 b: refs/heads/stable c: 1339ca9 h: refs/heads/master i: 274387: 783f555
1 parent 2123809 commit febc8b2

Some content is hidden

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

71 files changed

+810
-1934
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: 63cdec6a7fa2d92a300182e32561313c6ad5db5f
32+
refs/heads/stable: 1339ca9bf277ba30549fc2c1a21ce13b04fb60b1
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/installing-rust.html
12+
["Installing Rust"]: https://doc.rust-lang.org/book/getting-started.html#installing-rust
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/armv7s-apple-ios.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ CFG_LIB_GLOB_armv7s-apple-ios = lib$(1)-*.a
1414
CFG_INSTALL_ONLY_RLIB_armv7s-apple-ios = 1
1515
CFG_STATIC_LIB_NAME_armv7s-apple-ios=lib$(1).a
1616
CFG_LIB_DSYM_GLOB_armv7s-apple-ios = lib$(1)-*.a.dSYM
17-
CFG_JEMALLOC_CFLAGS_armv7s-apple-ios := -arch armv7s $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios)
18-
CFG_GCCISH_CFLAGS_armv7s-apple-ios := -Wall -Werror -g -fPIC $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios) -arch armv7s
17+
CFG_JEMALLOC_CFLAGS_armv7s-apple-ios := -arch armv7s -mfpu=vfp4 $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios)
18+
CFG_GCCISH_CFLAGS_armv7s-apple-ios := -Wall -Werror -g -fPIC $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios) -mfpu=vfp4 -arch armv7s
1919
CFG_GCCISH_CXXFLAGS_armv7s-apple-ios := -fno-rtti $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios) -I$(CFG_IOS_SDK_armv7s-apple-ios)/usr/include/c++/4.2.1
2020
CFG_GCCISH_LINK_FLAGS_armv7s-apple-ios := -lpthread -syslibroot $(CFG_IOS_SDK_armv7s-apple-ios) -Wl,-no_compact_unwind
2121
CFG_GCCISH_DEF_FLAG_armv7s-apple-ios := -Wl,-exported_symbols_list,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# powerpc64-unknown-linux-gnu configuration
2-
CROSS_PREFIX_powerpc64-unknown-linux-gnu=powerpc-linux-gnu-
2+
CROSS_PREFIX_powerpc64-unknown-linux-gnu=powerpc64-linux-gnu-
33
CC_powerpc64-unknown-linux-gnu=$(CC)
44
CXX_powerpc64-unknown-linux-gnu=$(CXX)
55
CPP_powerpc64-unknown-linux-gnu=$(CPP)

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/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ comments (`/** ... */`), are interpreted as a special syntax for `doc`
104104
`#[doc="..."]` around the body of the comment, i.e., `/// Foo` turns into
105105
`#[doc="Foo"]`.
106106

107-
Line comments beginning with `//!` and block comments `/*! ... */` are
107+
Line comments beginning with `//!` and block comments `/*! ... !*/` are
108108
doc comments that apply to the parent of the comment, rather than the item
109109
that follows. That is, they are equivalent to writing `#![doc="..."]` around
110110
the body of the comment. `//!` comments are usually used to document

branches/stable/src/libcollections/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ impl String {
641641
Cow::Owned(res)
642642
}
643643

644-
/// Decode a UTF-16 encoded vector `v` into a `String`, returning `Err`
644+
/// Decode a UTF-16 encoded vector `v` into a `String`, returning `None`
645645
/// if `v` contains any invalid data.
646646
///
647647
/// # Examples

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/liblibc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit 91ff43c736de664f8d3cd351e148c09cdea6731e
1+
Subproject commit af77843345ec6fc7e51113bfd692138d89024bc0

branches/stable/src/librustc/README.md

Lines changed: 35 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Rustc consists of a number of crates, including `libsyntax`,
2121
(the names and divisions are not set in stone and may change;
2222
in general, a finer-grained division of crates is preferable):
2323

24-
- [`libsyntax`][libsyntax] contains those things concerned purely with syntax –
24+
- `libsyntax` contains those things concerned purely with syntax –
2525
that is, the AST, parser, pretty-printer, lexer, macro expander, and
2626
utilities for traversing ASTs – are in a separate crate called
2727
"syntax", whose files are in `./../libsyntax`, where `.` is the
@@ -32,92 +32,32 @@ in general, a finer-grained division of crates is preferable):
3232
passes, such as the type checker, borrow checker, and so forth.
3333
It is the heart of the compiler.
3434

35-
- [`librustc_back`][back] contains some very low-level details that are
35+
- `librustc_back` contains some very low-level details that are
3636
specific to different LLVM targets and so forth.
3737

38-
- [`librustc_trans`][trans] contains the code to convert from Rust IR into LLVM
38+
- `librustc_trans` contains the code to convert from Rust IR into LLVM
3939
IR, and then from LLVM IR into machine code, as well as the main
4040
driver that orchestrates all the other passes and various other bits
4141
of miscellany. In general it contains code that runs towards the
4242
end of the compilation process.
4343

44-
- [`librustc_driver`][driver] invokes the compiler from
45-
[`libsyntax`][libsyntax], then the analysis phases from `librustc`, and
46-
finally the lowering and codegen passes from [`librustc_trans`][trans].
44+
- `librustc_driver` invokes the compiler from `libsyntax`, then the
45+
analysis phases from `librustc`, and finally the lowering and
46+
codegen passes from `librustc_trans`.
4747

4848
Roughly speaking the "order" of the three crates is as follows:
4949

50-
librustc_driver
51-
|
52-
+-----------------+-------------------+
53-
| |
5450
libsyntax -> librustc -> librustc_trans
51+
| |
52+
+-----------------+-------------------+
53+
|
54+
librustc_driver
55+
5556

57+
Modules in the rustc crate
58+
==========================
5659

57-
The compiler process:
58-
=====================
59-
60-
The Rust compiler is comprised of six main compilation phases.
61-
62-
1. Parsing input
63-
2. Configuration & expanding (cfg rules & syntax extension expansion)
64-
3. Running analysis passes
65-
4. Translation to LLVM
66-
5. LLVM passes
67-
6. Linking
68-
69-
Phase one is responsible for parsing & lexing the input to the compiler. The
70-
output of this phase is an abstract syntax tree (AST). The AST at this point
71-
includes all macro uses & attributes. This means code which will be later
72-
expanded and/or removed due to `cfg` attributes is still present in this
73-
version of the AST. Parsing abstracts away details about individual files which
74-
have been read into the AST.
75-
76-
Phase two handles configuration and macro expansion. You can think of this
77-
phase as a function acting on the AST from the previous phase. The input for
78-
this phase is the unexpanded AST from phase one, and the output is an expanded
79-
version of the same AST. This phase will expand all macros & syntax
80-
extensions and will evaluate all `cfg` attributes, potentially removing some
81-
code. The resulting AST will not contain any macros or `macro_use` statements.
82-
83-
The code for these first two phases is in [`libsyntax`][libsyntax].
84-
85-
After this phase, the compiler allocates IDs to each node in the AST
86-
(technically not every node, but most of them). If we are writing out
87-
dependencies, that happens now.
88-
89-
The third phase is analysis. This is the most complex phase in the compiler,
90-
and makes up much of the code. This phase included name resolution, type
91-
checking, borrow checking, type & lifetime inference, trait selection, method
92-
selection, linting and so on. Most of the error detection in the compiler comes
93-
from this phase (with the exception of parse errors which arise during
94-
parsing). The "output" of this phase is a set of side tables containing
95-
semantic information about the source program. The analysis code is in
96-
[`librustc`][rustc] and some other crates with the `librustc_` prefix.
97-
98-
The fourth phase is translation. This phase translates the AST (and the side
99-
tables from the previous phase) into LLVM IR (intermediate representation).
100-
This is achieved by calling into the LLVM libraries. The code for this is in
101-
[`librustc_trans`][trans].
102-
103-
Phase five runs the LLVM backend. This runs LLVM's optimization passes on the
104-
generated IR and generates machine code resulting in object files. This phase
105-
is not really part of the Rust compiler, as LLVM carries out all the work.
106-
The interface between LLVM and Rust is in [`librustc_llvm`][llvm].
107-
108-
The final phase, phase six, links the object files into an executable. This is
109-
again outsourced to other tools and not performed by the Rust compiler
110-
directly. The interface is in [`librustc_back`][back] (which also contains some
111-
things used primarily during translation).
112-
113-
A module called the driver coordinates all these phases. It handles all the
114-
highest level coordination of compilation from parsing command line arguments
115-
all the way to invoking the linker to produce an executable.
116-
117-
Modules in the librustc crate
118-
=============================
119-
120-
The librustc crate itself consists of the following submodules
60+
The rustc crate itself consists of the following submodules
12161
(mostly, but not entirely, in their own directories):
12262

12363
- session: options and data that pertain to the compilation session as
@@ -131,7 +71,7 @@ The librustc crate itself consists of the following submodules
13171
- util: ubiquitous types and helper functions
13272
- lib: bindings to LLVM
13373

134-
The entry-point for the compiler is main() in the [`librustc_driver`][driver]
74+
The entry-point for the compiler is main() in the librustc_driver
13575
crate.
13676

13777
The 3 central data structures:
@@ -166,9 +106,23 @@ The 3 central data structures:
166106
Each of these is an opaque pointer to an LLVM type,
167107
manipulated through the `lib::llvm` interface.
168108

169-
[libsyntax]: https://github.com/rust-lang/rust/tree/master/src/libsyntax/
170-
[trans]: https://github.com/rust-lang/rust/tree/master/src/librustc_trans/
171-
[llvm]: https://github.com/rust-lang/rust/tree/master/src/librustc_llvm/
172-
[back]: https://github.com/rust-lang/rust/tree/master/src/librustc_back/
173-
[rustc]: https://github.com/rust-lang/rust/tree/master/src/librustc/
174-
[driver]: https://github.com/rust-lang/rust/tree/master/src/librustc_driver
109+
110+
Control and information flow within the compiler:
111+
-------------------------------------------------
112+
113+
- main() in lib.rs assumes control on startup. Options are
114+
parsed, platform is detected, etc.
115+
116+
- `./../libsyntax/parse/parser.rs` parses the input files and produces
117+
an AST that represents the input crate.
118+
119+
- Multiple middle-end passes (`middle/resolve.rs`, `middle/typeck.rs`)
120+
analyze the semantics of the resulting AST. Each pass generates new
121+
information about the AST and stores it in various environment data
122+
structures. The driver passes environments to each compiler pass
123+
that needs to refer to them.
124+
125+
- Finally, the `trans` module in `librustc_trans` translates the Rust
126+
AST to LLVM bitcode in a type-directed way. When it's finished
127+
synthesizing LLVM values, rustc asks LLVM to write them out in some
128+
form (`.bc`, `.o`) and possibly run the system linker.

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
}

0 commit comments

Comments
 (0)