Skip to content

Commit 6872887

Browse files
committed
---
yaml --- r: 102084 b: refs/heads/master c: 4687e1d h: refs/heads/master v: v3
1 parent bdc52c9 commit 6872887

Some content is hidden

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

75 files changed

+113
-1487
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: 4995a85f401e17ea7a9b8eab32335b5fd13ce248
2+
refs/heads/master: 4687e1d67d2601c3a408b74224f5ceb353c77b71
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/.travis.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

trunk/configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ then
604604
LLVM_VERSION=$($LLVM_CONFIG --version)
605605

606606
case $LLVM_VERSION in
607-
(3.[2-5]svn|3.[2-5])
607+
(3.[2-4]svn|3.[2-4])
608608
msg "found ok version of LLVM: $LLVM_VERSION"
609609
;;
610610
(*)
@@ -626,7 +626,7 @@ then
626626
| cut -d ' ' -f 2)
627627

628628
case $CFG_CLANG_VERSION in
629-
(3.0svn | 3.0 | 3.1* | 3.2* | 3.3* | 3.4* | 3.5* )
629+
(3.0svn | 3.0 | 3.1* | 3.2* | 3.3* | 3.4* )
630630
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
631631
CFG_C_COMPILER="clang"
632632
;;

trunk/mk/main.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,8 @@ LLVM_TOOLS=bugpoint llc llvm-ar llvm-as llvm-dis llvm-mc opt llvm-extract
218218
define DEF_LLVM_VARS
219219
# The configure script defines these variables with the target triples
220220
# separated by Z. This defines new ones with the expected format.
221-
ifeq ($$(CFG_LLVM_ROOT),)
222221
CFG_LLVM_BUILD_DIR_$(1):=$$(CFG_LLVM_BUILD_DIR_$(subst -,_,$(1)))
223222
CFG_LLVM_INST_DIR_$(1):=$$(CFG_LLVM_INST_DIR_$(subst -,_,$(1)))
224-
else
225-
CFG_LLVM_INST_DIR_$(1):=$$(CFG_LLVM_ROOT)
226-
endif
227223

228224
# Any rules that depend on LLVM should depend on LLVM_CONFIG
229225
LLVM_CONFIG_$(1):=$$(CFG_LLVM_INST_DIR_$(1))/bin/llvm-config$$(X_$(1))

trunk/mk/prepare.mk

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717
# It requires the following variables to be set:
1818
#
19-
# PREPARE_HOST - the host triple
19+
# PREPARE_HOST - the host triple
2020
# PREPARE_TARGETS - the target triples, space separated
2121
# PREPARE_DEST_DIR - the directory to put the image
2222

@@ -172,10 +172,7 @@ prepare-target-$(2)-host-$(3)-$(1): \
172172
$$(if $$(findstring $(2),$$(CFG_HOST)), \
173173
$$(foreach crate,$$(HOST_CRATES), \
174174
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)),)
175-
# Only install if this host and target combo is being prepared. Also be sure to
176-
# *not* install the rlibs for host crates because there's no need to statically
177-
# link against most of them. They just produce a large amount of extra size
178-
# bloat.
175+
# Only install if this host and target combo is being prepared
179176
$$(if $$(findstring $(1), $$(PREPARE_STAGE)),\
180177
$$(if $$(findstring $(2), $$(PREPARE_TARGETS)),\
181178
$$(if $$(findstring $(3), $$(PREPARE_HOST)),\
@@ -185,7 +182,8 @@ prepare-target-$(2)-host-$(3)-$(1): \
185182
$$(call PREPARE_LIB,$$(call CFG_RLIB_GLOB,$$(crate))))\
186183
$$(if $$(findstring $(2),$$(CFG_HOST)),\
187184
$$(foreach crate,$$(HOST_CRATES),\
188-
$$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$(2),$$(crate)))),)\
185+
$$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$(2),$$(crate)))\
186+
$$(call PREPARE_LIB,$$(call CFG_RLIB_GLOB,$$(crate)))),)\
189187
$$(call PREPARE_LIB,libmorestack.a) \
190188
$$(call PREPARE_LIB,libcompiler-rt.a),),),)
191189
endef

trunk/src/etc/generate-deriving-span-tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ def write_file(name, string):
119119
('Clone', [], 1), ('DeepClone', ['Clone'], 1),
120120
('Eq', [], 2), ('Ord', [], 8),
121121
('TotalEq', [], 1), ('TotalOrd', ['TotalEq'], 1),
122-
('Show', [], 1),
123-
('Hash', [], 1)]:
122+
('Show', [], 1)]:
124123
traits[trait] = (ALL, supers, errs)
125124

126125
for (trait, (types, super_traits, error_count)) in traits.items():

trunk/src/libarena/lib.rs

Lines changed: 29 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ use std::cast::{transmute, transmute_mut, transmute_mut_region};
3131
use std::cast;
3232
use std::cell::{Cell, RefCell};
3333
use std::mem;
34+
use std::ptr::read;
3435
use std::cmp;
3536
use std::num;
3637
use std::kinds::marker;
@@ -345,37 +346,32 @@ pub struct TypedArena<T> {
345346
/// reached, a new chunk is allocated.
346347
priv end: *T,
347348

348-
/// The type descriptor of the objects in the arena. This should not be
349-
/// necessary, but is until generic destructors are supported.
350-
priv tydesc: *TyDesc,
351-
352349
/// A pointer to the first arena segment.
353-
priv first: Option<~TypedArenaChunk>,
350+
priv first: Option<~TypedArenaChunk<T>>,
354351
}
355352

356-
struct TypedArenaChunk {
353+
struct TypedArenaChunk<T> {
357354
/// Pointer to the next arena segment.
358-
next: Option<~TypedArenaChunk>,
355+
next: Option<~TypedArenaChunk<T>>,
359356

360357
/// The number of elements that this chunk can hold.
361358
capacity: uint,
362359

363360
// Objects follow here, suitably aligned.
364361
}
365362

366-
impl TypedArenaChunk {
363+
impl<T> TypedArenaChunk<T> {
367364
#[inline]
368-
fn new<T>(next: Option<~TypedArenaChunk>, capacity: uint)
369-
-> ~TypedArenaChunk {
370-
let mut size = mem::size_of::<TypedArenaChunk>();
365+
fn new(next: Option<~TypedArenaChunk<T>>, capacity: uint) -> ~TypedArenaChunk<T> {
366+
let mut size = mem::size_of::<TypedArenaChunk<T>>();
371367
size = round_up(size, mem::min_align_of::<T>());
372368
let elem_size = mem::size_of::<T>();
373369
let elems_size = elem_size.checked_mul(&capacity).unwrap();
374370
size = size.checked_add(&elems_size).unwrap();
375371

376372
let mut chunk = unsafe {
377373
let chunk = global_heap::exchange_malloc(size);
378-
let mut chunk: ~TypedArenaChunk = cast::transmute(chunk);
374+
let mut chunk: ~TypedArenaChunk<T> = cast::transmute(chunk);
379375
mem::move_val_init(&mut chunk.next, next);
380376
chunk
381377
};
@@ -387,16 +383,13 @@ impl TypedArenaChunk {
387383
/// Destroys this arena chunk. If the type descriptor is supplied, the
388384
/// drop glue is called; otherwise, drop glue is not called.
389385
#[inline]
390-
unsafe fn destroy(&mut self, len: uint, opt_tydesc: Option<*TyDesc>) {
386+
unsafe fn destroy(&mut self, len: uint) {
391387
// Destroy all the allocated objects.
392-
match opt_tydesc {
393-
None => {}
394-
Some(tydesc) => {
395-
let mut start = self.start(tydesc);
396-
for _ in range(0, len) {
397-
((*tydesc).drop_glue)(start as *i8);
398-
start = start.offset((*tydesc).size as int)
399-
}
388+
if intrinsics::needs_drop::<T>() {
389+
let mut start = self.start();
390+
for _ in range(0, len) {
391+
read(start as *T); // run the destructor on the pointer
392+
start = start.offset(mem::size_of::<T>() as int)
400393
}
401394
}
402395

@@ -406,26 +399,26 @@ impl TypedArenaChunk {
406399
None => {}
407400
Some(mut next) => {
408401
// We assume that the next chunk is completely filled.
409-
next.destroy(next.capacity, opt_tydesc)
402+
next.destroy(next.capacity)
410403
}
411404
}
412405
}
413406

414407
// Returns a pointer to the first allocated object.
415408
#[inline]
416-
fn start(&self, tydesc: *TyDesc) -> *u8 {
417-
let this: *TypedArenaChunk = self;
409+
fn start(&self) -> *u8 {
410+
let this: *TypedArenaChunk<T> = self;
418411
unsafe {
419-
cast::transmute(round_up(this.offset(1) as uint, (*tydesc).align))
412+
cast::transmute(round_up(this.offset(1) as uint, mem::min_align_of::<T>()))
420413
}
421414
}
422415

423416
// Returns a pointer to the end of the allocated space.
424417
#[inline]
425-
fn end(&self, tydesc: *TyDesc) -> *u8 {
418+
fn end(&self) -> *u8 {
426419
unsafe {
427-
let size = (*tydesc).size.checked_mul(&self.capacity).unwrap();
428-
self.start(tydesc).offset(size as int)
420+
let size = mem::size_of::<T>().checked_mul(&self.capacity).unwrap();
421+
self.start().offset(size as int)
429422
}
430423
}
431424
}
@@ -441,14 +434,10 @@ impl<T> TypedArena<T> {
441434
/// objects.
442435
#[inline]
443436
pub fn with_capacity(capacity: uint) -> TypedArena<T> {
444-
let chunk = TypedArenaChunk::new::<T>(None, capacity);
445-
let tydesc = unsafe {
446-
intrinsics::get_tydesc::<T>()
447-
};
437+
let chunk = TypedArenaChunk::<T>::new(None, capacity);
448438
TypedArena {
449-
ptr: chunk.start(tydesc) as *T,
450-
end: chunk.end(tydesc) as *T,
451-
tydesc: tydesc,
439+
ptr: chunk.start() as *T,
440+
end: chunk.end() as *T,
452441
first: Some(chunk),
453442
}
454443
}
@@ -475,9 +464,9 @@ impl<T> TypedArena<T> {
475464
fn grow(&mut self) {
476465
let chunk = self.first.take_unwrap();
477466
let new_capacity = chunk.capacity.checked_mul(&2).unwrap();
478-
let chunk = TypedArenaChunk::new::<T>(Some(chunk), new_capacity);
479-
self.ptr = chunk.start(self.tydesc) as *T;
480-
self.end = chunk.end(self.tydesc) as *T;
467+
let chunk = TypedArenaChunk::<T>::new(Some(chunk), new_capacity);
468+
self.ptr = chunk.start() as *T;
469+
self.end = chunk.end() as *T;
481470
self.first = Some(chunk)
482471
}
483472
}
@@ -486,18 +475,13 @@ impl<T> TypedArena<T> {
486475
impl<T> Drop for TypedArena<T> {
487476
fn drop(&mut self) {
488477
// Determine how much was filled.
489-
let start = self.first.get_ref().start(self.tydesc) as uint;
478+
let start = self.first.get_ref().start() as uint;
490479
let end = self.ptr as uint;
491480
let diff = (end - start) / mem::size_of::<T>();
492481

493482
// Pass that to the `destroy` method.
494483
unsafe {
495-
let opt_tydesc = if intrinsics::needs_drop::<T>() {
496-
Some(self.tydesc)
497-
} else {
498-
None
499-
};
500-
self.first.get_mut_ref().destroy(diff, opt_tydesc)
484+
self.first.get_mut_ref().destroy(diff)
501485
}
502486
}
503487
}

trunk/src/libextra/stats.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#[allow(missing_doc)];
1212

1313
use std::cmp;
14-
use std::hash_old::Hash;
1514
use std::hashmap;
1615
use std::io;
1716
use std::mem;

trunk/src/librustc/back/link.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ use std::run;
3434
use std::str;
3535
use std::io;
3636
use std::io::fs;
37-
use flate;
3837
use serialize::hex::ToHex;
3938
use extra::tempfile::TempDir;
4039
use syntax::abi;
@@ -943,15 +942,6 @@ fn link_rlib(sess: Session,
943942
// For LTO purposes, the bytecode of this library is also inserted
944943
// into the archive.
945944
let bc = obj_filename.with_extension("bc");
946-
match fs::File::open(&bc).read_to_end().and_then(|data| {
947-
fs::File::create(&bc).write(flate::deflate_bytes(data))
948-
}) {
949-
Ok(()) => {}
950-
Err(e) => {
951-
sess.err(format!("failed to compress bytecode: {}", e));
952-
sess.abort_if_errors()
953-
}
954-
}
955945
a.add_file(&bc, false);
956946
if !sess.opts.cg.save_temps &&
957947
!sess.opts.output_types.contains(&OutputTypeBitcode) {

trunk/src/librustc/back/lto.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use metadata::cstore;
1616
use util::common::time;
1717

1818
use std::libc;
19-
use flate;
2019

2120
pub fn run(sess: session::Session, llmod: ModuleRef,
2221
tm: TargetMachineRef, reachable: &[~str]) {
@@ -56,8 +55,6 @@ pub fn run(sess: session::Session, llmod: ModuleRef,
5655
let bc = time(sess.time_passes(), format!("read {}.bc", name), (), |_|
5756
archive.read(format!("{}.bc", name)));
5857
let bc = bc.expect("missing bytecode in archive!");
59-
let bc = time(sess.time_passes(), format!("inflate {}.bc", name), (), |_|
60-
flate::inflate_bytes(bc));
6158
let ptr = bc.as_ptr();
6259
debug!("linking {}", name);
6360
time(sess.time_passes(), format!("ll link {}", name), (), |()| unsafe {

trunk/src/librustc/metadata/decoder.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ use middle::typeck;
2727
use middle::astencode::vtable_decoder_helpers;
2828

2929
use std::u64;
30-
use std::hash_old::Hash;
3130
use std::io;
3231
use std::io::extensions::u64_from_be_bytes;
3332
use std::option;

trunk/src/librustc/metadata/encoder.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ use middle;
2626
use serialize::Encodable;
2727
use std::cast;
2828
use std::cell::{Cell, RefCell};
29-
use std::hash_old::Hash;
3029
use std::hashmap::{HashMap, HashSet};
3130
use std::io::MemWriter;
3231
use std::str;

trunk/src/librustc/metadata/loader.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,11 @@ fn get_metadata_section_imp(os: Os, filename: &Path) -> Option<MetadataBlob> {
407407
debug!("checking {} bytes of metadata-version stamp",
408408
vlen);
409409
let minsz = cmp::min(vlen, csz);
410-
let version_ok = vec::raw::buf_as_slice(cvbuf, minsz,
411-
|buf0| buf0 == encoder::metadata_encoding_version);
410+
let mut version_ok = false;
411+
vec::raw::buf_as_slice(cvbuf, minsz, |buf0| {
412+
version_ok = (buf0 ==
413+
encoder::metadata_encoding_version);
414+
});
412415
if !version_ok { return None; }
413416

414417
let cvbuf1 = cvbuf.offset(vlen as int);

trunk/src/librustc/middle/borrowck/gather_loans/lifetime.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ impl<'a> GuaranteeLifetimeContext<'a> {
9595
let base_scope = self.scope(base);
9696

9797
// L-Deref-Managed-Imm-User-Root
98-
let omit_root =
98+
let omit_root = (
9999
self.bccx.is_subregion_of(self.loan_region, base_scope) &&
100100
self.is_rvalue_or_immutable(base) &&
101-
!self.is_moved(base);
101+
!self.is_moved(base)
102+
);
102103

103104
if !omit_root {
104105
// L-Deref-Managed-Imm-Compiler-Root

trunk/src/librustc/middle/dataflow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ fn bitwise(out_vec: &mut [uint], in_vec: &[uint], op: |uint, uint| -> uint)
891891
let old_val = *out_elt;
892892
let new_val = op(old_val, *in_elt);
893893
*out_elt = new_val;
894-
changed |= old_val != new_val;
894+
changed |= (old_val != new_val);
895895
}
896896
changed
897897
}

0 commit comments

Comments
 (0)