Skip to content

Commit ae60ce8

Browse files
committed
---
yaml --- r: 173498 b: refs/heads/master c: 8903c21 h: refs/heads/master v: v3
1 parent b37d6e6 commit ae60ce8

Some content is hidden

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

73 files changed

+1197
-720
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 98d471120a09607ad429bebf56c97b512bdf9847
2+
refs/heads/master: 8903c21d618fd25dca61d9bb668c5299d21feac9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 210f0dcf007104240b2e286ed0b80cb4a61d7bae
55
refs/heads/try: 957472483d3a2f43c0e4f7c2056280a1022af93c

trunk/configure

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,10 @@ case $CFG_CPUTYPE in
448448
CFG_CPUTYPE=aarch64
449449
;;
450450

451+
powerpc)
452+
CFG_CPUTYPE=powerpc
453+
;;
454+
451455
x86_64 | x86-64 | x64 | amd64)
452456
CFG_CPUTYPE=x86_64
453457
;;
@@ -1004,7 +1008,7 @@ do
10041008
make_dir $t/rt/jemalloc
10051009
for i in \
10061010
isaac sync test \
1007-
arch/i386 arch/x86_64 arch/arm arch/aarch64 arch/mips
1011+
arch/i386 arch/x86_64 arch/arm arch/aarch64 arch/mips arch/powerpc
10081012
do
10091013
make_dir $t/rt/stage$s/$i
10101014
done
@@ -1169,7 +1173,7 @@ do
11691173

11701174
msg "configuring LLVM for $gnu_t"
11711175

1172-
LLVM_TARGETS="--enable-targets=x86,x86_64,arm,aarch64,mips"
1176+
LLVM_TARGETS="--enable-targets=x86,x86_64,arm,aarch64,mips,powerpc"
11731177
LLVM_BUILD="--build=$gnu_t"
11741178
LLVM_HOST="--host=$gnu_t"
11751179
LLVM_TARGET="--target=$gnu_t"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# powerpc-unknown-linux-gnu configuration
2+
CROSS_PREFIX_powerpc-unknown-linux-gnu=powerpc-linux-gnu-
3+
CC_powerpc-unknown-linux-gnu=$(CC)
4+
CXX_powerpc-unknown-linux-gnu=$(CXX)
5+
CPP_powerpc-unknown-linux-gnu=$(CPP)
6+
AR_powerpc-unknown-linux-gnu=$(AR)
7+
CFG_LIB_NAME_powerpc-unknown-linux-gnu=lib$(1).so
8+
CFG_STATIC_LIB_NAME_powerpc-unknown-linux-gnu=lib$(1).a
9+
CFG_LIB_GLOB_powerpc-unknown-linux-gnu=lib$(1)-*.so
10+
CFG_LIB_DSYM_GLOB_powerpc-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
11+
CFG_CFLAGS_powerpc-unknown-linux-gnu := -m32 $(CFLAGS)
12+
CFG_GCCISH_CFLAGS_powerpc-unknown-linux-gnu := -Wall -Werror -g -fPIC -m32 $(CFLAGS)
13+
CFG_GCCISH_CXXFLAGS_powerpc-unknown-linux-gnu := -fno-rtti $(CXXFLAGS)
14+
CFG_GCCISH_LINK_FLAGS_powerpc-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m32
15+
CFG_GCCISH_DEF_FLAG_powerpc-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list=
16+
CFG_GCCISH_PRE_LIB_FLAGS_powerpc-unknown-linux-gnu := -Wl,-whole-archive
17+
CFG_GCCISH_POST_LIB_FLAGS_powerpc-unknown-linux-gnu := -Wl,-no-whole-archive
18+
CFG_DEF_SUFFIX_powerpc-unknown-linux-gnu := .linux.def
19+
CFG_LLC_FLAGS_powerpc-unknown-linux-gnu :=
20+
CFG_INSTALL_NAME_powerpc-unknown-linux-gnu =
21+
CFG_EXE_SUFFIX_powerpc-unknown-linux-gnu =
22+
CFG_WINDOWSY_powerpc-unknown-linux-gnu :=
23+
CFG_UNIXY_powerpc-unknown-linux-gnu := 1
24+
CFG_PATH_MUNGE_powerpc-unknown-linux-gnu := true
25+
CFG_LDPATH_powerpc-unknown-linux-gnu :=
26+
CFG_RUN_powerpc-unknown-linux-gnu=$(2)
27+
CFG_RUN_TARG_powerpc-unknown-linux-gnu=$(call CFG_RUN_powerpc-unknown-linux-gnu,,$(2))
28+
CFG_GNU_TRIPLE_powerpc-unknown-linux-gnu := powerpc-unknown-linux-gnu

trunk/mk/main.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ endif
263263
######################################################################
264264

265265
# FIXME: x86-ism
266-
LLVM_COMPONENTS=x86 arm aarch64 mips ipo bitreader bitwriter linker asmparser mcjit \
266+
LLVM_COMPONENTS=x86 arm aarch64 mips powerpc ipo bitreader bitwriter linker asmparser mcjit \
267267
interpreter instrumentation
268268

269269
# Only build these LLVM tools

trunk/mk/platform.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ define CFG_MAKE_TOOLCHAIN
177177
$$(CFG_GCCISH_DEF_FLAG_$(1))$$(3) $$(2) \
178178
$$(call CFG_INSTALL_NAME_$(1),$$(4))
179179

180-
ifeq ($$(findstring $(HOST_$(1)),arm aarch64 mips mipsel),)
180+
ifeq ($$(findstring $(HOST_$(1)),arm aarch64 mips mipsel powerpc),)
181181

182182
# We're using llvm-mc as our assembler because it supports
183183
# .cfi pseudo-ops on mac
@@ -189,7 +189,7 @@ define CFG_MAKE_TOOLCHAIN
189189
-o=$$(1)
190190
else
191191

192-
# For the ARM, AARCH64 and MIPS crosses, use the toolchain assembler
192+
# For the ARM, AARCH64, MIPS and POWER crosses, use the toolchain assembler
193193
# FIXME: We should be able to use the LLVM assembler
194194
CFG_ASSEMBLE_$(1)=$$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \
195195
$$(CFG_DEPEND_FLAGS) $$(2) -c -o $$(1)

trunk/src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2170,7 +2170,7 @@ arbitrarily complex configurations through nesting.
21702170
The following configurations must be defined by the implementation:
21712171

21722172
* `target_arch = "..."`. Target CPU architecture, such as `"x86"`, `"x86_64"`
2173-
`"mips"`, `"arm"`, or `"aarch64"`.
2173+
`"mips"`, `"powerpc"`, `"arm"`, or `"aarch64"`.
21742174
* `target_endian = "..."`. Endianness of the target CPU, either `"little"` or
21752175
`"big"`.
21762176
* `target_family = "..."`. Operating system family of the target, e. g.

trunk/src/liballoc/heap.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ unsafe fn exchange_free(ptr: *mut u8, old_size: uint, align: uint) {
119119
not(feature = "external_crate"),
120120
any(target_arch = "arm",
121121
target_arch = "mips",
122-
target_arch = "mipsel")))]
122+
target_arch = "mipsel",
123+
target_arch = "powerpc")))]
123124
const MIN_ALIGN: uint = 8;
124125
#[cfg(all(not(feature = "external_funcs"),
125126
not(feature = "external_crate"),

trunk/src/libcoretest/mem.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,14 @@ fn size_of_basic() {
1919
}
2020

2121
#[test]
22-
#[cfg(any(target_arch = "x86",
23-
target_arch = "arm",
24-
target_arch = "mips",
25-
target_arch = "mipsel"))]
22+
#[cfg(target_pointer_width = "32")]
2623
fn size_of_32() {
2724
assert_eq!(size_of::<uint>(), 4u);
2825
assert_eq!(size_of::<*const uint>(), 4u);
2926
}
3027

3128
#[test]
32-
#[cfg(any(target_arch = "x86_64",
33-
target_arch = "aarch64"))]
29+
#[cfg(target_pointer_width = "64")]
3430
fn size_of_64() {
3531
assert_eq!(size_of::<uint>(), 8u);
3632
assert_eq!(size_of::<*const uint>(), 8u);
@@ -52,18 +48,14 @@ fn align_of_basic() {
5248
}
5349

5450
#[test]
55-
#[cfg(any(target_arch = "x86",
56-
target_arch = "arm",
57-
target_arch = "mips",
58-
target_arch = "mipsel"))]
51+
#[cfg(target_pointer_width = "32")]
5952
fn align_of_32() {
6053
assert_eq!(align_of::<uint>(), 4u);
6154
assert_eq!(align_of::<*const uint>(), 4u);
6255
}
6356

6457
#[test]
65-
#[cfg(any(target_arch = "x86_64",
66-
target_arch = "aarch64"))]
58+
#[cfg(target_pointer_width = "64")]
6759
fn align_of_64() {
6860
assert_eq!(align_of::<uint>(), 8u);
6961
assert_eq!(align_of::<*const uint>(), 8u);

trunk/src/liblibc/lib.rs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,8 @@ pub mod types {
497497
#[cfg(any(target_arch = "x86",
498498
target_arch = "arm",
499499
target_arch = "mips",
500-
target_arch = "mipsel"))]
500+
target_arch = "mipsel",
501+
target_arch = "powerpc"))]
501502
pub mod arch {
502503
pub mod c95 {
503504
pub type c_char = i8;
@@ -528,7 +529,8 @@ pub mod types {
528529
}
529530
#[cfg(any(target_arch = "x86",
530531
target_arch = "mips",
531-
target_arch = "mipsel"))]
532+
target_arch = "mipsel",
533+
target_arch = "powerpc"))]
532534
pub mod posix88 {
533535
pub type off_t = i32;
534536
pub type dev_t = u64;
@@ -642,7 +644,9 @@ pub mod types {
642644
pub __size: [u32; 9]
643645
}
644646
}
645-
#[cfg(any(target_arch = "mips", target_arch = "mipsel"))]
647+
#[cfg(any(target_arch = "mips",
648+
target_arch = "mipsel",
649+
target_arch = "powerpc"))]
646650
pub mod posix01 {
647651
use types::os::arch::c95::{c_long, c_ulong, time_t};
648652
use types::os::arch::posix88::{gid_t, ino_t};
@@ -2697,7 +2701,9 @@ pub mod consts {
26972701
pub const EHWPOISON: c_int = 133;
26982702
}
26992703

2700-
#[cfg(any(target_arch = "mips", target_arch = "mipsel"))]
2704+
#[cfg(any(target_arch = "mips",
2705+
target_arch = "mipsel",
2706+
target_arch = "powerpc"))]
27012707
pub mod posix88 {
27022708
use types::os::arch::c95::c_int;
27032709
use types::common::c95::c_void;
@@ -2982,7 +2988,8 @@ pub mod consts {
29822988
#[cfg(all(target_os = "linux",
29832989
any(target_arch = "mips",
29842990
target_arch = "mipsel",
2985-
target_arch = "aarch64")))]
2991+
target_arch = "aarch64",
2992+
target_arch = "powerpc")))]
29862993
pub const PTHREAD_STACK_MIN: size_t = 131072;
29872994

29882995
pub const CLOCK_REALTIME: c_int = 0;
@@ -3040,7 +3047,9 @@ pub mod consts {
30403047
pub const SHUT_WR: c_int = 1;
30413048
pub const SHUT_RDWR: c_int = 2;
30423049
}
3043-
#[cfg(any(target_arch = "mips", target_arch = "mipsel"))]
3050+
#[cfg(any(target_arch = "mips",
3051+
target_arch = "mipsel",
3052+
target_arch = "powerpc"))]
30443053
pub mod bsd44 {
30453054
use types::os::arch::c95::c_int;
30463055

@@ -3115,7 +3124,9 @@ pub mod consts {
31153124
pub const MAP_NONBLOCK : c_int = 0x010000;
31163125
pub const MAP_STACK : c_int = 0x020000;
31173126
}
3118-
#[cfg(any(target_arch = "mips", target_arch = "mipsel"))]
3127+
#[cfg(any(target_arch = "mips",
3128+
target_arch = "mipsel",
3129+
target_arch = "powerpc"))]
31193130
pub mod extra {
31203131
use types::os::arch::c95::c_int;
31213132

trunk/src/librustc/lint/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1731,7 +1731,7 @@ impl LintPass for Stability {
17311731
let mut span = e.span;
17321732

17331733
let id = match e.node {
1734-
ast::ExprPath(..) | ast::ExprStruct(..) => {
1734+
ast::ExprPath(..) | ast::ExprQPath(..) | ast::ExprStruct(..) => {
17351735
match cx.tcx.def_map.borrow().get(&e.id) {
17361736
Some(&def) => def.def_id(),
17371737
None => return

trunk/src/librustc/middle/cfg/construct.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,8 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
495495
ast::ExprMac(..) |
496496
ast::ExprClosure(..) |
497497
ast::ExprLit(..) |
498-
ast::ExprPath(..) => {
498+
ast::ExprPath(..) |
499+
ast::ExprQPath(..) => {
499500
self.straightline(expr, pred, None::<ast::Expr>.iter())
500501
}
501502
}

trunk/src/librustc/middle/check_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ fn check_expr(v: &mut CheckCrateVisitor, e: &ast::Expr) {
111111
expression");
112112
}
113113
}
114-
ast::ExprPath(_) => {
114+
ast::ExprPath(_) | ast::ExprQPath(_) => {
115115
match v.tcx.def_map.borrow()[e.id] {
116116
DefStatic(..) | DefConst(..) |
117117
DefFn(..) | DefStaticMethod(..) | DefMethod(..) |

trunk/src/librustc/middle/check_static.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for CheckStaticVisitor<'a, 'tcx> {
228228
"{} are not allowed to have custom pointers",
229229
self.msg());
230230
}
231-
ast::ExprPath(..) => {
231+
ast::ExprPath(_) | ast::ExprQPath(_) => {
232232
match ty::resolve_expr(self.tcx, e) {
233233
def::DefStatic(..) if self.mode == InConstant => {
234234
let msg = "constants cannot refer to other statics, \

trunk/src/librustc/middle/check_static_recursion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl<'a, 'ast, 'v> Visitor<'v> for CheckItemRecursionVisitor<'a, 'ast> {
9393

9494
fn visit_expr(&mut self, e: &ast::Expr) {
9595
match e.node {
96-
ast::ExprPath(..) => {
96+
ast::ExprPath(_) | ast::ExprQPath(_) => {
9797
match self.def_map.borrow().get(&e.id) {
9898
Some(&DefStatic(def_id, _)) |
9999
Some(&DefConst(def_id)) if

trunk/src/librustc/middle/const_eval.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ impl<'a, 'tcx> ConstEvalVisitor<'a, 'tcx> {
244244

245245
// FIXME: (#3728) we can probably do something CCI-ish
246246
// surrounding nonlocal constants. But we don't yet.
247-
ast::ExprPath(_) => self.lookup_constness(e),
247+
ast::ExprPath(_) | ast::ExprQPath(_) => self.lookup_constness(e),
248248

249249
ast::ExprRepeat(..) => general_const,
250250

@@ -356,6 +356,13 @@ pub fn const_expr_to_pat(tcx: &ty::ctxt, expr: &Expr) -> P<ast::Pat> {
356356
}
357357
}
358358

359+
ast::ExprQPath(_) => {
360+
match lookup_const(tcx, expr) {
361+
Some(actual) => return const_expr_to_pat(tcx, actual),
362+
_ => unreachable!()
363+
}
364+
}
365+
359366
_ => ast::PatLit(P(expr.clone()))
360367
};
361368
P(ast::Pat { id: expr.id, node: pat, span: expr.span })
@@ -542,7 +549,7 @@ pub fn eval_const_expr_partial(tcx: &ty::ctxt, e: &Expr) -> Result<const_val, St
542549
ty::ty_float(ast::TyF64) => (f64, const_float, f64)
543550
}))
544551
}
545-
ast::ExprPath(_) => {
552+
ast::ExprPath(_) | ast::ExprQPath(_) => {
546553
match lookup_const(tcx, e) {
547554
Some(actual_e) => eval_const_expr_partial(tcx, &*actual_e),
548555
None => Err("non-constant path in constant expr".to_string())

trunk/src/librustc/middle/effect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EffectCheckVisitor<'a, 'tcx> {
175175
ast::ExprInlineAsm(..) => {
176176
self.require_unsafe(expr.span, "use of inline assembly");
177177
}
178-
ast::ExprPath(..) => {
178+
ast::ExprPath(_) | ast::ExprQPath(_) => {
179179
if let def::DefStatic(_, true) = ty::resolve_expr(self.tcx, expr) {
180180
self.require_unsafe(expr.span, "use of mutable static");
181181
}

trunk/src/librustc/middle/expr_use_visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
424424
self.walk_expr(&**subexpr)
425425
}
426426

427-
ast::ExprPath(..) => { }
427+
ast::ExprPath(_) | ast::ExprQPath(_) => { }
428428

429429
ast::ExprUnary(ast::UnDeref, ref base) => { // *base
430430
if !self.walk_overloaded_operator(expr, &**base, Vec::new(), PassArgs::ByRef) {

trunk/src/librustc/middle/liveness.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ fn visit_arm(ir: &mut IrMaps, arm: &ast::Arm) {
447447
fn visit_expr(ir: &mut IrMaps, expr: &Expr) {
448448
match expr.node {
449449
// live nodes required for uses or definitions of variables:
450-
ast::ExprPath(_) => {
450+
ast::ExprPath(_) | ast::ExprQPath(_) => {
451451
let def = ir.tcx.def_map.borrow()[expr.id].clone();
452452
debug!("expr {}: path that leads to {:?}", expr.id, def);
453453
if let DefLocal(..) = def {
@@ -960,7 +960,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
960960
match expr.node {
961961
// Interesting cases with control flow or which gen/kill
962962

963-
ast::ExprPath(_) => {
963+
ast::ExprPath(_) | ast::ExprQPath(_) => {
964964
self.access_path(expr, succ, ACC_READ | ACC_USE)
965965
}
966966

@@ -1289,7 +1289,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
12891289
// just ignore such cases and treat them as reads.
12901290

12911291
match expr.node {
1292-
ast::ExprPath(_) => succ,
1292+
ast::ExprPath(_) | ast::ExprQPath(_) => succ,
12931293
ast::ExprField(ref e, _) => self.propagate_through_expr(&**e, succ),
12941294
ast::ExprTupField(ref e, _) => self.propagate_through_expr(&**e, succ),
12951295
_ => self.propagate_through_expr(expr, succ)
@@ -1300,7 +1300,9 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
13001300
fn write_lvalue(&mut self, expr: &Expr, succ: LiveNode, acc: uint)
13011301
-> LiveNode {
13021302
match expr.node {
1303-
ast::ExprPath(_) => self.access_path(expr, succ, acc),
1303+
ast::ExprPath(_) | ast::ExprQPath(_) => {
1304+
self.access_path(expr, succ, acc)
1305+
}
13041306

13051307
// We do not track other lvalues, so just propagate through
13061308
// to their subcomponents. Also, it may happen that
@@ -1492,7 +1494,7 @@ fn check_expr(this: &mut Liveness, expr: &Expr) {
14921494
ast::ExprBlock(..) | ast::ExprMac(..) | ast::ExprAddrOf(..) |
14931495
ast::ExprStruct(..) | ast::ExprRepeat(..) | ast::ExprParen(..) |
14941496
ast::ExprClosure(..) | ast::ExprPath(..) | ast::ExprBox(..) |
1495-
ast::ExprRange(..) => {
1497+
ast::ExprRange(..) | ast::ExprQPath(..) => {
14961498
visit::walk_expr(this, expr);
14971499
}
14981500
ast::ExprIfLet(..) => {
@@ -1583,7 +1585,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
15831585

15841586
fn check_lvalue(&mut self, expr: &Expr) {
15851587
match expr.node {
1586-
ast::ExprPath(_) => {
1588+
ast::ExprPath(_) | ast::ExprQPath(_) => {
15871589
if let DefLocal(nid) = self.ir.tcx.def_map.borrow()[expr.id].clone() {
15881590
// Assignment to an immutable variable or argument: only legal
15891591
// if there is no later assignment. If this local is actually

trunk/src/librustc/middle/mem_categorization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
520520
}
521521
}
522522

523-
ast::ExprPath(_) => {
523+
ast::ExprPath(_) | ast::ExprQPath(_) => {
524524
let def = (*self.tcx().def_map.borrow())[expr.id];
525525
self.cat_def(expr.id, expr.span, expr_ty, def)
526526
}

trunk/src/librustc/middle/privacy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for PrivacyVisitor<'a, 'tcx> {
920920
struct type?!"),
921921
}
922922
}
923-
ast::ExprPath(..) => {
923+
ast::ExprPath(_) | ast::ExprQPath(_) => {
924924
let guard = |&: did: ast::DefId| {
925925
let fields = ty::lookup_struct_fields(self.tcx, did);
926926
let any_priv = fields.iter().any(|f| {

0 commit comments

Comments
 (0)