Skip to content

Commit e7b223c

Browse files
committed
---
yaml --- r: 146257 b: refs/heads/try2 c: dba6070 h: refs/heads/master i: 146255: 4ba70c8 v: v3
1 parent a5f69c9 commit e7b223c

Some content is hidden

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

70 files changed

+1965
-1558
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 17b87d20304db1e8727754b7ef900dc3c986d878
8+
refs/heads/try2: dba60700804119f7e953e6b2b72ce4875c9d60cb
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/rt.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ RUNTIME_CXXS_$(1)_$(2) := \
8989
rt/rust_upcall.cpp \
9090
rt/rust_uv.cpp \
9191
rt/miniz.cpp \
92-
rt/memory_region.cpp \
93-
rt/boxed_region.cpp \
9492
rt/rust_android_dummy.cpp \
9593
rt/rust_test_helpers.cpp
9694

branches/try2/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use util::logv;
2323
use std::cell::Cell;
2424
use std::rt::io;
2525
use std::rt::io::Writer;
26-
use std::rt::io::extensions::ReaderUtil;
26+
use std::rt::io::Reader;
2727
use std::rt::io::file::FileInfo;
2828
use std::os;
2929
use std::str;

branches/try2/src/libextra/json.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use std::f64;
2222
use std::hashmap::HashMap;
2323
use std::rt::io;
2424
use std::rt::io::Decorator;
25-
use std::rt::io::extensions::ReaderUtil;
2625
use std::rt::io::mem::MemWriter;
2726
use std::num;
2827
use std::str;
@@ -843,7 +842,7 @@ impl<T : Iterator<char>> Parser<T> {
843842
}
844843

845844
/// Decodes a json value from an `&mut io::Reader`
846-
pub fn from_reader(mut rdr: &mut io::Reader) -> Result<Json, Error> {
845+
pub fn from_reader(rdr: &mut io::Reader) -> Result<Json, Error> {
847846
let s = str::from_utf8(rdr.read_to_end());
848847
let mut parser = Parser(~s.iter());
849848
parser.parse()

branches/try2/src/libextra/sync.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ mod tests {
918918
let m = Mutex::new();
919919
let m2 = m.clone();
920920

921-
let result: result::Result<(),()> = do task::try {
921+
let result: result::Result<(), ~Any> = do task::try {
922922
do m2.lock {
923923
fail!();
924924
}
@@ -935,7 +935,7 @@ mod tests {
935935
let m = Mutex::new();
936936
let m2 = m.clone();
937937

938-
let result: result::Result<(),()> = do task::try {
938+
let result: result::Result<(), ~Any> = do task::try {
939939
let (p, c) = comm::stream();
940940
do task::spawn || { // linked
941941
let _ = p.recv(); // wait for sibling to get in the mutex
@@ -963,7 +963,7 @@ mod tests {
963963
let m2 = m.clone();
964964
let (p, c) = comm::stream();
965965

966-
let result: result::Result<(),()> = do task::try {
966+
let result: result::Result<(), ~Any> = do task::try {
967967
let mut sibling_convos = ~[];
968968
do 2.times {
969969
let (p, c) = comm::stream();
@@ -1272,7 +1272,7 @@ mod tests {
12721272
let x = RWLock::new();
12731273
let x2 = x.clone();
12741274

1275-
let result: result::Result<(),()> = do task::try || {
1275+
let result: result::Result<(), ~Any> = do task::try || {
12761276
do lock_rwlock_in_mode(&x2, mode1) {
12771277
fail!();
12781278
}

branches/try2/src/libextra/terminfo/parser/compiled.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use std::{vec, str};
1717
use std::hashmap::HashMap;
1818
use std::rt::io;
19-
use std::rt::io::extensions::{ReaderByteConversions, ReaderUtil};
2019
use super::super::TermInfo;
2120

2221
// These are the orders ncurses uses in its compiled format (as of 5.9). Not sure if portable.
@@ -161,7 +160,7 @@ pub static stringnames: &'static[&'static str] = &'static[ "cbt", "_", "cr", "cs
161160
"box1"];
162161

163162
/// Parse a compiled terminfo entry, using long capability names if `longnames` is true
164-
pub fn parse(mut file: &mut io::Reader,
163+
pub fn parse(file: &mut io::Reader,
165164
longnames: bool) -> Result<~TermInfo, ~str> {
166165
let bnames;
167166
let snames;
@@ -178,17 +177,17 @@ pub fn parse(mut file: &mut io::Reader,
178177
}
179178

180179
// Check magic number
181-
let magic = file.read_le_u16_();
180+
let magic = file.read_le_u16();
182181
if (magic != 0x011A) {
183182
return Err(format!("invalid magic number: expected {:x} but found {:x}",
184183
0x011A, magic as uint));
185184
}
186185

187-
let names_bytes = file.read_le_i16_() as int;
188-
let bools_bytes = file.read_le_i16_() as int;
189-
let numbers_count = file.read_le_i16_() as int;
190-
let string_offsets_count = file.read_le_i16_() as int;
191-
let string_table_bytes = file.read_le_i16_() as int;
186+
let names_bytes = file.read_le_i16() as int;
187+
let bools_bytes = file.read_le_i16() as int;
188+
let numbers_count = file.read_le_i16() as int;
189+
let string_offsets_count = file.read_le_i16() as int;
190+
let string_table_bytes = file.read_le_i16() as int;
192191

193192
assert!(names_bytes > 0);
194193

@@ -247,7 +246,7 @@ pub fn parse(mut file: &mut io::Reader,
247246
let mut numbers_map = HashMap::new();
248247
if numbers_count != 0 {
249248
for i in range(0, numbers_count) {
250-
let n = file.read_le_u16_();
249+
let n = file.read_le_u16();
251250
if n != 0xFFFF {
252251
debug!("{}\\#{}", nnames[i], n);
253252
numbers_map.insert(nnames[i].to_owned(), n);
@@ -262,7 +261,7 @@ pub fn parse(mut file: &mut io::Reader,
262261
if string_offsets_count != 0 {
263262
let mut string_offsets = vec::with_capacity(10);
264263
for _ in range(0, string_offsets_count) {
265-
string_offsets.push(file.read_le_u16_());
264+
string_offsets.push(file.read_le_u16());
266265
}
267266

268267
debug!("offsets: {:?}", string_offsets);

branches/try2/src/libextra/test.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -873,8 +873,7 @@ pub fn run_test(force_ignore: bool,
873873
task.spawn(testfn_cell.take());
874874

875875
let task_result = result_future.recv();
876-
let test_result = calc_result(&desc,
877-
task_result == task::Success);
876+
let test_result = calc_result(&desc, task_result.is_ok());
878877
monitor_ch.send((desc.clone(), test_result));
879878
}
880879
}

branches/try2/src/libextra/workcache.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use std::comm::{PortOne, oneshot};
2020
use std::{os, str, task};
2121
use std::rt::io;
2222
use std::rt::io::Writer;
23+
use std::rt::io::Reader;
2324
use std::rt::io::Decorator;
2425
use std::rt::io::mem::MemWriter;
2526
use std::rt::io::file::FileInfo;
@@ -481,7 +482,7 @@ impl<'self, T:Send +
481482
#[test]
482483
fn test() {
483484
use std::{os, run};
484-
use std::rt::io::ReaderUtil;
485+
use std::rt::io::Reader;
485486
use std::str::from_utf8_owned;
486487

487488
// Create a path to a new file 'filename' in the directory in which

branches/try2/src/librustc/driver/driver.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,9 @@ pub fn build_session_options(binary: @str,
757757

758758
let statik = debugging_opts & session::statik != 0;
759759

760-
let addl_lib_search_paths = matches.opt_strs("L").map(|s| Path::new(s.as_slice()));
760+
let addl_lib_search_paths = matches.opt_strs("L").map(|s| {
761+
Path::new(s.as_slice())
762+
}).move_iter().collect();
761763
let linker = matches.opt_str("linker");
762764
let linker_args = matches.opt_strs("link-args").flat_map( |a| {
763765
a.split_iter(' ').map(|arg| arg.to_owned()).collect()

branches/try2/src/librustc/driver/session.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use syntax::parse::token;
2929
use syntax;
3030

3131
use std::int;
32-
use std::hashmap::HashMap;
32+
use std::hashmap::{HashMap,HashSet};
3333

3434
#[deriving(Eq)]
3535
pub enum Os { OsWin32, OsMacos, OsLinux, OsAndroid, OsFreebsd, }
@@ -158,9 +158,9 @@ pub struct options {
158158
save_temps: bool,
159159
jit: bool,
160160
output_type: back::link::output_type,
161-
addl_lib_search_paths: @mut ~[Path], // This is mutable for rustpkg, which
162-
// updates search paths based on the
163-
// parsed code
161+
addl_lib_search_paths: @mut HashSet<Path>, // This is mutable for rustpkg, which
162+
// updates search paths based on the
163+
// parsed code
164164
linker: Option<~str>,
165165
linker_args: ~[~str],
166166
maybe_sysroot: Option<@Path>,
@@ -366,7 +366,7 @@ pub fn basic_options() -> @options {
366366
save_temps: false,
367367
jit: false,
368368
output_type: link::output_type_exe,
369-
addl_lib_search_paths: @mut ~[],
369+
addl_lib_search_paths: @mut HashSet::new(),
370370
linker: None,
371371
linker_args: ~[],
372372
maybe_sysroot: None,

branches/try2/src/librustc/metadata/encoder.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use middle::typeck;
2222
use middle;
2323

2424
use std::hashmap::{HashMap, HashSet};
25-
use std::rt::io::extensions::WriterByteConversions;
2625
use std::rt::io::{Writer, Seek, Decorator};
2726
use std::rt::io::mem::MemWriter;
2827
use std::str;
@@ -894,11 +893,11 @@ fn encode_info_for_item(ecx: &EncodeContext,
894893
vis: ast::visibility) {
895894
let tcx = ecx.tcx;
896895

897-
fn add_to_index_(item: @item, ebml_w: &writer::Encoder,
896+
fn add_to_index(item: @item, ebml_w: &writer::Encoder,
898897
index: @mut ~[entry<i64>]) {
899898
index.push(entry { val: item.id as i64, pos: ebml_w.writer.tell() });
900899
}
901-
let add_to_index: &fn() = || add_to_index_(item, ebml_w, index);
900+
let add_to_index: &fn() = || add_to_index(item, ebml_w, index);
902901

903902
debug!("encoding info for item at {}",
904903
ecx.tcx.sess.codemap.span_to_str(item.span));
@@ -1411,7 +1410,7 @@ fn encode_index<T:'static>(
14111410
assert!(elt.pos < 0xffff_ffff);
14121411
{
14131412
let wr: &mut MemWriter = ebml_w.writer;
1414-
wr.write_be_u32_(elt.pos as u32);
1413+
wr.write_be_u32(elt.pos as u32);
14151414
}
14161415
write_fn(ebml_w.writer, &elt.val);
14171416
ebml_w.end_tag();
@@ -1423,7 +1422,7 @@ fn encode_index<T:'static>(
14231422
for pos in bucket_locs.iter() {
14241423
assert!(*pos < 0xffff_ffff);
14251424
let wr: &mut MemWriter = ebml_w.writer;
1426-
wr.write_be_u32_(*pos as u32);
1425+
wr.write_be_u32(*pos as u32);
14271426
}
14281427
ebml_w.end_tag();
14291428
ebml_w.end_tag();
@@ -1436,7 +1435,7 @@ fn write_str(writer: @mut MemWriter, s: ~str) {
14361435
fn write_i64(writer: @mut MemWriter, &n: &i64) {
14371436
let wr: &mut MemWriter = writer;
14381437
assert!(n < 0x7fff_ffff);
1439-
wr.write_be_u32_(n as u32);
1438+
wr.write_be_u32(n as u32);
14401439
}
14411440

14421441
fn encode_meta_item(ebml_w: &mut writer::Encoder, mi: @MetaItem) {
@@ -1591,14 +1590,14 @@ fn encode_lang_items(ecx: &EncodeContext, ebml_w: &mut writer::Encoder) {
15911590
ebml_w.start_tag(tag_lang_items_item_id);
15921591
{
15931592
let wr: &mut MemWriter = ebml_w.writer;
1594-
wr.write_be_u32_(i as u32);
1593+
wr.write_be_u32(i as u32);
15951594
}
15961595
ebml_w.end_tag(); // tag_lang_items_item_id
15971596

15981597
ebml_w.start_tag(tag_lang_items_item_node_id);
15991598
{
16001599
let wr: &mut MemWriter = ebml_w.writer;
1601-
wr.write_be_u32_(id.node as u32);
1600+
wr.write_be_u32(id.node as u32);
16021601
}
16031602
ebml_w.end_tag(); // tag_lang_items_item_node_id
16041603

branches/try2/src/librustc/metadata/filesearch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ pub trait FileSearch {
4040

4141
pub fn mk_filesearch(maybe_sysroot: &Option<@Path>,
4242
target_triple: &str,
43-
addl_lib_search_paths: @mut ~[Path])
43+
addl_lib_search_paths: @mut HashSet<Path>)
4444
-> @FileSearch {
4545
struct FileSearchImpl {
4646
sysroot: @Path,
47-
addl_lib_search_paths: @mut ~[Path],
47+
addl_lib_search_paths: @mut HashSet<Path>,
4848
target_triple: ~str
4949
}
5050
impl FileSearch for FileSearchImpl {

branches/try2/src/librustc/middle/trans/base.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2844,6 +2844,8 @@ pub fn declare_intrinsics(llmod: ModuleRef) -> HashMap<&'static str, ValueRef> {
28442844
ifn!(intrinsics, "llvm.umul.with.overflow.i64",
28452845
[Type::i64(), Type::i64()], Type::struct_([Type::i64(), Type::i1()], false));
28462846

2847+
ifn!(intrinsics, "llvm.expect.i1", [Type::i1(), Type::i1()], Type::i1());
2848+
28472849
return intrinsics;
28482850
}
28492851

branches/try2/src/librustc/middle/trans/common.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ pub fn type_is_immediate(ccx: &mut CrateContext, ty: ty::t) -> bool {
7070
return true;
7171
}
7272
match ty::get(ty).sty {
73+
ty::ty_bot => true,
7374
ty::ty_struct(*) | ty::ty_enum(*) | ty::ty_tup(*) => {
7475
let llty = sizing_type_of(ccx, ty);
7576
llsize_of_alloc(ccx, llty) <= llsize_of_alloc(ccx, ccx.int_type)

branches/try2/src/librustc/middle/trans/expr.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,9 @@ fn trans_lvalue_unadjusted(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock {
981981
debug!("trans_index: len {}", bcx.val_to_str(len));
982982

983983
let bounds_check = ICmp(bcx, lib::llvm::IntUGE, ix_val, len);
984-
let bcx = do with_cond(bcx, bounds_check) |bcx| {
984+
let expect = ccx.intrinsics.get_copy(&("llvm.expect.i1"));
985+
let expected = Call(bcx, expect, [bounds_check, C_i1(false)], []);
986+
let bcx = do with_cond(bcx, expected) |bcx| {
985987
controlflow::trans_fail_bounds_check(bcx, index_expr.span, ix_val, len)
986988
};
987989
let elt = InBoundsGEP(bcx, base, [ix_val]);

branches/try2/src/librustc/rustc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use middle::lint;
3737

3838
use std::comm;
3939
use std::rt::io;
40-
use std::rt::io::extensions::ReaderUtil;
40+
use std::rt::io::Reader;
4141
use std::num;
4242
use std::os;
4343
use std::result;

branches/try2/src/librustdoc/core.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use syntax;
2020

2121
use std::os;
2222
use std::local_data;
23-
use std::hashmap::HashMap;
23+
use std::hashmap::{HashMap,HashSet};
2424

2525
use visit_ast::RustdocVisitor;
2626
use clean;
@@ -39,7 +39,7 @@ pub struct CrateAnalysis {
3939

4040
/// Parses, resolves, and typechecks the given crate
4141
fn get_ast_and_resolve(cpath: &Path,
42-
libs: ~[Path]) -> (DocContext, CrateAnalysis) {
42+
libs: HashSet<Path>) -> (DocContext, CrateAnalysis) {
4343
use syntax::codemap::dummy_spanned;
4444
use rustc::driver::driver::{file_input, build_configuration,
4545
phase_1_parse_input,
@@ -89,7 +89,7 @@ fn get_ast_and_resolve(cpath: &Path,
8989
CrateAnalysis { reexports: reexports, exported_items: exported_items });
9090
}
9191

92-
pub fn run_core (libs: ~[Path], path: &Path) -> (clean::Crate, CrateAnalysis) {
92+
pub fn run_core (libs: HashSet<Path>, path: &Path) -> (clean::Crate, CrateAnalysis) {
9393
let (ctxt, analysis) = get_ast_and_resolve(path, libs);
9494
let ctxt = @ctxt;
9595
debug!("defmap:");

branches/try2/src/librustdoc/rustdoc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
198198
info!("starting to run rustc");
199199
let (crate, analysis) = do std::task::try {
200200
let cr = cr.take();
201-
core::run_core(libs.take(), &cr)
201+
core::run_core(libs.take().move_iter().collect(), &cr)
202202
}.unwrap();
203203
info!("finished with rustc");
204204
local_data::set(analysiskey, analysis);

0 commit comments

Comments
 (0)