Skip to content

Commit 2e069b2

Browse files
committed
---
yaml --- r: 120203 b: refs/heads/dist-snap c: 8b912bc h: refs/heads/master i: 120201: 8dbb1eb 120199: e010392 v: v3
1 parent 3dd6003 commit 2e069b2

33 files changed

+1385
-1567
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 1813e5aa1a03b0596b8de7abd1af31edf5d6098f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: e031ba1028a1705708401a04f5823bcc3e4a439c
9+
refs/heads/dist-snap: 8b912bc56be35149a405752f134b8b659366a35c
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libarena/lib.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -341,29 +341,7 @@ struct TypedArenaChunk<T> {
341341
}
342342

343343
impl<T> TypedArenaChunk<T> {
344-
#[cfg(stage0)]
345344
#[inline]
346-
fn new(next: Option<Box<TypedArenaChunk<T>>>, capacity: uint)
347-
-> Box<TypedArenaChunk<T>> {
348-
let mut size = mem::size_of::<TypedArenaChunk<T>>();
349-
size = round_up(size, min_align_of::<T>());
350-
let elem_size = mem::size_of::<T>();
351-
let elems_size = elem_size.checked_mul(&capacity).unwrap();
352-
size = size.checked_add(&elems_size).unwrap();
353-
354-
let mut chunk = unsafe {
355-
let chunk = exchange_malloc(size);
356-
let mut chunk: Box<TypedArenaChunk<T>> = mem::transmute(chunk);
357-
mem::move_val_init(&mut chunk.next, next);
358-
chunk
359-
};
360-
361-
chunk.capacity = capacity;
362-
chunk
363-
}
364-
365-
#[inline]
366-
#[cfg(not(stage0))]
367345
fn new(next: Option<Box<TypedArenaChunk<T>>>, capacity: uint)
368346
-> Box<TypedArenaChunk<T>> {
369347
let mut size = mem::size_of::<TypedArenaChunk<T>>();

branches/dist-snap/src/libcore/should_not_exist.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,10 @@ use str::StrSlice;
2828

2929
#[allow(ctypes)]
3030
extern {
31-
#[cfg(stage0)]
32-
fn rust_malloc(size: uint) -> *u8;
33-
#[cfg(not(stage0))]
3431
fn rust_malloc(size: uint, align: uint) -> *u8;
3532
fn rust_free(ptr: *u8, size: uint, align: uint);
3633
}
3734

38-
#[cfg(stage0)]
39-
unsafe fn alloc(cap: uint) -> *mut Vec<()> {
40-
let cap = cap.checked_add(&mem::size_of::<Vec<()>>()).unwrap();
41-
let ret = rust_malloc(cap) as *mut Vec<()>;
42-
if ret.is_null() {
43-
intrinsics::abort();
44-
}
45-
(*ret).fill = 0;
46-
(*ret).alloc = cap;
47-
ret
48-
}
49-
50-
#[cfg(not(stage0))]
5135
unsafe fn alloc(cap: uint) -> *mut Vec<()> {
5236
let cap = cap.checked_add(&mem::size_of::<Vec<()>>()).unwrap();
5337
// this should use the real alignment, but the new representation will take care of that

branches/dist-snap/src/librustc/back/arm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use back::target_strs;
12-
use driver::config::cfg_os_to_meta_os;
12+
use driver::session::sess_os_to_meta_os;
1313
use metadata::loader::meta_section_name;
1414
use syntax::abi;
1515

@@ -22,7 +22,7 @@ pub fn get_target_strs(target_triple: ~str, target_os: abi::Os) -> target_strs::
2222
return target_strs::t {
2323
module_asm: "".to_owned(),
2424

25-
meta_sect_name: meta_section_name(cfg_os_to_meta_os(target_os)).to_owned(),
25+
meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)).to_owned(),
2626

2727
data_layout: match target_os {
2828
abi::OsMacos => {

branches/dist-snap/src/librustc/back/link.rs

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ use back::archive::{Archive, METADATA_FILENAME};
1212
use back::rpath;
1313
use back::svh::Svh;
1414
use driver::driver::{CrateTranslation, OutputFilenames};
15-
use driver::config::NoDebugInfo;
16-
use driver::session::Session;
17-
use driver::config;
15+
use driver::session::{NoDebugInfo, Session};
16+
use driver::session;
1817
use lib::llvm::llvm;
1918
use lib::llvm::ModuleRef;
2019
use lib;
@@ -93,9 +92,8 @@ pub mod write {
9392
use back::link::{OutputTypeExe, OutputTypeLlvmAssembly};
9493
use back::link::{OutputTypeObject};
9594
use driver::driver::{CrateTranslation, OutputFilenames};
96-
use driver::config::NoDebugInfo;
97-
use driver::session::Session;
98-
use driver::config;
95+
use driver::session::{NoDebugInfo, Session};
96+
use driver::session;
9997
use lib::llvm::llvm;
10098
use lib::llvm::{ModuleRef, TargetMachineRef, PassManagerRef};
10199
use lib;
@@ -141,10 +139,10 @@ pub mod write {
141139
}
142140

143141
let opt_level = match sess.opts.optimize {
144-
config::No => lib::llvm::CodeGenLevelNone,
145-
config::Less => lib::llvm::CodeGenLevelLess,
146-
config::Default => lib::llvm::CodeGenLevelDefault,
147-
config::Aggressive => lib::llvm::CodeGenLevelAggressive,
142+
session::No => lib::llvm::CodeGenLevelNone,
143+
session::Less => lib::llvm::CodeGenLevelLess,
144+
session::Default => lib::llvm::CodeGenLevelDefault,
145+
session::Aggressive => lib::llvm::CodeGenLevelAggressive,
148146
};
149147
let use_softfp = sess.opts.cg.soft_float;
150148

@@ -233,7 +231,7 @@ pub mod write {
233231
// emitting an rlib. Whenever an rlib is created, the bytecode is
234232
// inserted into the archive in order to allow LTO against it.
235233
if sess.opts.cg.save_temps ||
236-
(sess.crate_types.borrow().contains(&config::CrateTypeRlib) &&
234+
(sess.crate_types.borrow().contains(&session::CrateTypeRlib) &&
237235
sess.opts.output_types.contains(&OutputTypeExe)) {
238236
output.temp_path(OutputTypeBitcode).with_c_str(|buf| {
239237
llvm::LLVMWriteBitcodeToFile(llmod, buf);
@@ -380,10 +378,10 @@ pub mod write {
380378
// Copy what clang does by turning on loop vectorization at O2 and
381379
// slp vectorization at O3
382380
let vectorize_loop = !sess.opts.cg.no_vectorize_loops &&
383-
(sess.opts.optimize == config::Default ||
384-
sess.opts.optimize == config::Aggressive);
381+
(sess.opts.optimize == session::Default ||
382+
sess.opts.optimize == session::Aggressive);
385383
let vectorize_slp = !sess.opts.cg.no_vectorize_slp &&
386-
sess.opts.optimize == config::Aggressive;
384+
sess.opts.optimize == session::Aggressive;
387385

388386
let mut llvm_c_strs = Vec::new();
389387
let mut llvm_args = Vec::new();
@@ -825,14 +823,14 @@ fn is_writeable(p: &Path) -> bool {
825823
}
826824
}
827825

828-
pub fn filename_for_input(sess: &Session, crate_type: config::CrateType,
826+
pub fn filename_for_input(sess: &Session, crate_type: session::CrateType,
829827
id: &CrateId, out_filename: &Path) -> Path {
830828
let libname = output_lib_filename(id);
831829
match crate_type {
832-
config::CrateTypeRlib => {
830+
session::CrateTypeRlib => {
833831
out_filename.with_filename(format!("lib{}.rlib", libname))
834832
}
835-
config::CrateTypeDylib => {
833+
session::CrateTypeDylib => {
836834
let (prefix, suffix) = match sess.targ_cfg.os {
837835
abi::OsWin32 => (loader::WIN32_DLL_PREFIX, loader::WIN32_DLL_SUFFIX),
838836
abi::OsMacos => (loader::MACOS_DLL_PREFIX, loader::MACOS_DLL_SUFFIX),
@@ -842,16 +840,16 @@ pub fn filename_for_input(sess: &Session, crate_type: config::CrateType,
842840
};
843841
out_filename.with_filename(format!("{}{}{}", prefix, libname, suffix))
844842
}
845-
config::CrateTypeStaticlib => {
843+
session::CrateTypeStaticlib => {
846844
out_filename.with_filename(format!("lib{}.a", libname))
847845
}
848-
config::CrateTypeExecutable => out_filename.clone(),
846+
session::CrateTypeExecutable => out_filename.clone(),
849847
}
850848
}
851849

852850
fn link_binary_output(sess: &Session,
853851
trans: &CrateTranslation,
854-
crate_type: config::CrateType,
852+
crate_type: session::CrateType,
855853
outputs: &OutputFilenames,
856854
id: &CrateId) -> Path {
857855
let obj_filename = outputs.temp_path(OutputTypeObject);
@@ -879,16 +877,16 @@ fn link_binary_output(sess: &Session,
879877
}
880878

881879
match crate_type {
882-
config::CrateTypeRlib => {
880+
session::CrateTypeRlib => {
883881
link_rlib(sess, Some(trans), &obj_filename, &out_filename);
884882
}
885-
config::CrateTypeStaticlib => {
883+
session::CrateTypeStaticlib => {
886884
link_staticlib(sess, &obj_filename, &out_filename);
887885
}
888-
config::CrateTypeExecutable => {
886+
session::CrateTypeExecutable => {
889887
link_natively(sess, trans, false, &obj_filename, &out_filename);
890888
}
891-
config::CrateTypeDylib => {
889+
session::CrateTypeDylib => {
892890
link_natively(sess, trans, true, &obj_filename, &out_filename);
893891
}
894892
}
@@ -1047,7 +1045,7 @@ fn link_natively(sess: &Session, trans: &CrateTranslation, dylib: bool,
10471045
let mut cc_args = sess.targ_cfg.target_strs.cc_args.clone();
10481046
cc_args.push_all_move(link_args(sess, dylib, tmpdir.path(), trans,
10491047
obj_filename, out_filename));
1050-
if (sess.opts.debugging_opts & config::PRINT_LINK_ARGS) != 0 {
1048+
if (sess.opts.debugging_opts & session::PRINT_LINK_ARGS) != 0 {
10511049
println!("{} link args: '{}'", cc_prog, cc_args.connect("' '"));
10521050
}
10531051

@@ -1163,8 +1161,8 @@ fn link_args(sess: &Session,
11631161

11641162
// GNU-style linkers support optimization with -O. GNU ld doesn't need a
11651163
// numeric argument, but other linkers do.
1166-
if sess.opts.optimize == config::Default ||
1167-
sess.opts.optimize == config::Aggressive {
1164+
if sess.opts.optimize == session::Default ||
1165+
sess.opts.optimize == session::Aggressive {
11681166
args.push("-Wl,-O1".to_owned());
11691167
}
11701168
} else if sess.targ_cfg.os == abi::OsMacos {
@@ -1375,9 +1373,9 @@ fn add_upstream_rust_crates(args: &mut Vec<~str>, sess: &Session,
13751373
// involves just passing the right -l flag.
13761374

13771375
let data = if dylib {
1378-
trans.crate_formats.get(&config::CrateTypeDylib)
1376+
trans.crate_formats.get(&session::CrateTypeDylib)
13791377
} else {
1380-
trans.crate_formats.get(&config::CrateTypeExecutable)
1378+
trans.crate_formats.get(&session::CrateTypeExecutable)
13811379
};
13821380

13831381
// Invoke get_used_crates to ensure that we get a topological sorting of
@@ -1405,7 +1403,7 @@ fn add_upstream_rust_crates(args: &mut Vec<~str>, sess: &Session,
14051403
}
14061404

14071405
// Converts a library file-stem into a cc -l argument
1408-
fn unlib(config: &config::Config, stem: &str) -> ~str {
1406+
fn unlib(config: &session::Config, stem: &str) -> ~str {
14091407
if stem.starts_with("lib") && config.os != abi::OsWin32 {
14101408
stem.slice(3, stem.len()).to_owned()
14111409
} else {

branches/dist-snap/src/librustc/back/lto.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use back::archive::ArchiveRO;
1212
use back::link;
1313
use driver::session;
14-
use driver::config;
1514
use lib::llvm::{ModuleRef, TargetMachineRef, llvm, True, False};
1615
use metadata::cstore;
1716
use util::common::time;
@@ -30,7 +29,7 @@ pub fn run(sess: &session::Session, llmod: ModuleRef,
3029
// Make sure we actually can run LTO
3130
for crate_type in sess.crate_types.borrow().iter() {
3231
match *crate_type {
33-
config::CrateTypeExecutable | config::CrateTypeStaticlib => {}
32+
session::CrateTypeExecutable | session::CrateTypeStaticlib => {}
3433
_ => {
3534
sess.fatal("lto can only be run for executables and \
3635
static library outputs");

branches/dist-snap/src/librustc/back/mips.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
// except according to those terms.
1010

1111
use back::target_strs;
12-
use driver::config::cfg_os_to_meta_os;
12+
use driver::session::sess_os_to_meta_os;
1313
use metadata::loader::meta_section_name;
1414
use syntax::abi;
1515

1616
pub fn get_target_strs(target_triple: ~str, target_os: abi::Os) -> target_strs::t {
1717
return target_strs::t {
1818
module_asm: "".to_owned(),
1919

20-
meta_sect_name: meta_section_name(cfg_os_to_meta_os(target_os)).to_owned(),
20+
meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)).to_owned(),
2121

2222
data_layout: match target_os {
2323
abi::OsMacos => {

branches/dist-snap/src/librustc/back/x86.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010

1111

1212
use back::target_strs;
13-
use driver::config::cfg_os_to_meta_os;
13+
use driver::session::sess_os_to_meta_os;
1414
use metadata::loader::meta_section_name;
1515
use syntax::abi;
1616

1717
pub fn get_target_strs(target_triple: ~str, target_os: abi::Os) -> target_strs::t {
1818
return target_strs::t {
1919
module_asm: "".to_owned(),
2020

21-
meta_sect_name: meta_section_name(cfg_os_to_meta_os(target_os)).to_owned(),
21+
meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)).to_owned(),
2222

2323
data_layout: match target_os {
2424
abi::OsMacos => {

branches/dist-snap/src/librustc/back/x86_64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010

1111

1212
use back::target_strs;
13-
use driver::config::cfg_os_to_meta_os;
13+
use driver::session::sess_os_to_meta_os;
1414
use metadata::loader::meta_section_name;
1515
use syntax::abi;
1616

1717
pub fn get_target_strs(target_triple: ~str, target_os: abi::Os) -> target_strs::t {
1818
return target_strs::t {
1919
module_asm: "".to_owned(),
2020

21-
meta_sect_name: meta_section_name(cfg_os_to_meta_os(target_os)).to_owned(),
21+
meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)).to_owned(),
2222

2323
data_layout: match target_os {
2424
abi::OsMacos => {

0 commit comments

Comments
 (0)