Skip to content

Commit 3a38fe7

Browse files
committed
---
yaml --- r: 147445 b: refs/heads/try2 c: cab44fb h: refs/heads/master i: 147443: 4f9b0f2 v: v3
1 parent 0bf06c9 commit 3a38fe7

File tree

24 files changed

+434
-499
lines changed

24 files changed

+434
-499
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: d975060de6c944ca12ce5205fbc9fc7726948ae1
8+
refs/heads/try2: cab44fb076b4bc56a5877304a7b7617325cb8573
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/tests.mk

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -745,27 +745,21 @@ CRATE_DOC_LIB-extra = $(EXTRALIB_CRATE)
745745

746746
define DEF_CRATE_DOC_TEST
747747

748-
check-stage$(1)-T-$(2)-H-$(3)-doc-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4))
748+
check-stage$(1)-T-$(2)-H-$(2)-doc-$(3)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(2),doc-$(3))
749749

750-
ifeq ($(2),$$(CFG_BUILD))
751-
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): \
752-
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
753-
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3))
754-
@$$(call E, run doc-$(4) [$(2)])
755-
$$(Q)$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) --test \
756-
$$(CRATE_DOC_LIB-$(4)) && touch $$@
757-
else
758-
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)):
759-
touch $$@
760-
endif
750+
$$(call TEST_OK_FILE,$(1),$(2),$(2),doc-$(3)): \
751+
$$(TEST_SREQ$(1)_T_$(2)_H_$(2)) \
752+
$$(HBIN$(1)_H_$(2))/rustdoc$$(X_$(2))
753+
@$$(call E, run doc-$(3) [$(2)])
754+
$$(Q)$$(HBIN$(1)_H_$(2))/rustdoc$$(X_$(2)) --test \
755+
$$(CRATE_DOC_LIB-$(3)) && touch $$@
761756

762757
endef
763758

764759
$(foreach host,$(CFG_HOST), \
765-
$(foreach target,$(CFG_TARGET), \
766-
$(foreach stage,$(STAGES), \
767-
$(foreach crate,$(TEST_DOC_CRATES), \
768-
$(eval $(call DEF_CRATE_DOC_TEST,$(stage),$(target),$(host),$(crate)))))))
760+
$(foreach stage,$(STAGES), \
761+
$(foreach crate,$(TEST_DOC_CRATES), \
762+
$(eval $(call DEF_CRATE_DOC_TEST,$(stage),$(host),$(crate))))))
769763

770764
######################################################################
771765
# Extracting tests for docs

branches/try2/src/librustc/back/link.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ fn link_rlib(sess: Session,
838838
out_filename: &Path) -> Archive {
839839
let mut a = Archive::create(sess, out_filename, obj_filename);
840840

841-
for &(ref l, kind) in sess.cstore.get_used_libraries().iter() {
841+
for &(ref l, kind) in cstore::get_used_libraries(sess.cstore).iter() {
842842
match kind {
843843
cstore::NativeStatic => {
844844
a.add_native_library(l.as_slice());
@@ -912,9 +912,9 @@ fn link_staticlib(sess: Session, obj_filename: &Path, out_filename: &Path) {
912912
let mut a = link_rlib(sess, None, obj_filename, out_filename);
913913
a.add_native_library("morestack");
914914

915-
let crates = sess.cstore.get_used_crates(cstore::RequireStatic);
915+
let crates = cstore::get_used_crates(sess.cstore, cstore::RequireStatic);
916916
for &(cnum, ref path) in crates.iter() {
917-
let name = sess.cstore.get_crate_data(cnum).name;
917+
let name = cstore::get_crate_data(sess.cstore, cnum).name;
918918
let p = match *path {
919919
Some(ref p) => p.clone(), None => {
920920
sess.err(format!("could not find rlib for: `{}`", name));
@@ -1072,7 +1072,7 @@ fn link_args(sess: Session,
10721072
// Finally add all the linker arguments provided on the command line along
10731073
// with any #[link_args] attributes found inside the crate
10741074
args.push_all(sess.opts.linker_args);
1075-
for arg in sess.cstore.get_used_link_args().iter() {
1075+
for arg in cstore::get_used_link_args(sess.cstore).iter() {
10761076
args.push(arg.clone());
10771077
}
10781078
return args;
@@ -1101,7 +1101,7 @@ fn add_local_native_libraries(args: &mut ~[~str], sess: Session) {
11011101
args.push("-L" + path.as_str().unwrap().to_owned());
11021102
}
11031103

1104-
for &(ref l, kind) in sess.cstore.get_used_libraries().iter() {
1104+
for &(ref l, kind) in cstore::get_used_libraries(sess.cstore).iter() {
11051105
match kind {
11061106
cstore::NativeUnknown | cstore::NativeStatic => {
11071107
args.push("-l" + *l);
@@ -1143,7 +1143,7 @@ fn add_upstream_rust_crates(args: &mut ~[~str], sess: Session,
11431143
// all dynamic libaries require dynamic dependencies (see above), so
11441144
// it's satisfactory to include either all static libraries or all
11451145
// dynamic libraries.
1146-
let crates = cstore.get_used_crates(cstore::RequireStatic);
1146+
let crates = cstore::get_used_crates(cstore, cstore::RequireStatic);
11471147
if crates.iter().all(|&(_, ref p)| p.is_some()) {
11481148
for (cnum, path) in crates.move_iter() {
11491149
let cratepath = path.unwrap();
@@ -1163,7 +1163,7 @@ fn add_upstream_rust_crates(args: &mut ~[~str], sess: Session,
11631163
// If we're not doing LTO, then our job is simply to just link
11641164
// against the archive.
11651165
if sess.lto() {
1166-
let name = sess.cstore.get_crate_data(cnum).name;
1166+
let name = cstore::get_crate_data(sess.cstore, cnum).name;
11671167
time(sess.time_passes(), format!("altering {}.rlib", name),
11681168
(), |()| {
11691169
let dst = tmpdir.join(cratepath.filename().unwrap());
@@ -1196,13 +1196,13 @@ fn add_upstream_rust_crates(args: &mut ~[~str], sess: Session,
11961196
// this case is the fallback
11971197
// * If an executable is being created, and one of the inputs is missing as
11981198
// a static library, then this is the fallback case.
1199-
let crates = cstore.get_used_crates(cstore::RequireDynamic);
1199+
let crates = cstore::get_used_crates(cstore, cstore::RequireDynamic);
12001200
for &(cnum, ref path) in crates.iter() {
12011201
let cratepath = match *path {
12021202
Some(ref p) => p.clone(),
12031203
None => {
12041204
sess.err(format!("could not find dynamic library for: `{}`",
1205-
sess.cstore.get_crate_data(cnum).name));
1205+
cstore::get_crate_data(sess.cstore, cnum).name));
12061206
return
12071207
}
12081208
};
@@ -1235,7 +1235,7 @@ fn add_upstream_rust_crates(args: &mut ~[~str], sess: Session,
12351235
// also be resolved in the target crate.
12361236
fn add_upstream_native_libraries(args: &mut ~[~str], sess: Session) {
12371237
let cstore = sess.cstore;
1238-
cstore.iter_crate_data(|cnum, _| {
1238+
cstore::iter_crate_data(cstore, |cnum, _| {
12391239
let libs = csearch::get_native_libraries(cstore, cnum);
12401240
for &(kind, ref lib) in libs.iter() {
12411241
match kind {

branches/try2/src/librustc/back/lto.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ pub fn run(sess: session::Session, llmod: ModuleRef,
3333
// For each of our upstream dependencies, find the corresponding rlib and
3434
// load the bitcode from the archive. Then merge it into the current LLVM
3535
// module that we've got.
36-
let crates = sess.cstore.get_used_crates(cstore::RequireStatic);
36+
let crates = cstore::get_used_crates(sess.cstore, cstore::RequireStatic);
3737
for (cnum, path) in crates.move_iter() {
38-
let name = sess.cstore.get_crate_data(cnum).name;
38+
let name = cstore::get_crate_data(sess.cstore, cnum).name;
3939
let path = match path {
4040
Some(p) => p,
4141
None => {

branches/try2/src/librustc/back/rpath.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub fn get_rpath_flags(sess: session::Session, out_filename: &Path) -> ~[~str] {
4141

4242
let sysroot = sess.filesearch.sysroot();
4343
let output = out_filename;
44-
let libs = sess.cstore.get_used_crates(cstore::RequireDynamic);
44+
let libs = cstore::get_used_crates(sess.cstore, cstore::RequireDynamic);
4545
let libs = libs.move_iter().filter_map(|(_, l)| l.map(|p| p.clone())).collect();
4646
// We don't currently rpath extern libraries, but we know
4747
// where rustrt is and we know every rust program needs it

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ use front;
1818
use lib::llvm::llvm;
1919
use lib::llvm::{ContextRef, ModuleRef};
2020
use metadata::common::LinkMeta;
21-
use metadata::{creader, filesearch};
22-
use metadata::cstore::CStore;
21+
use metadata::{creader, cstore, filesearch};
2322
use metadata;
2423
use middle::{trans, freevars, kind, ty, typeck, lint, astencode, reachable};
2524
use middle;
@@ -854,7 +853,7 @@ pub fn build_session_(sopts: @session::options,
854853
let target_cfg = build_target_config(sopts, demitter);
855854
let p_s = parse::new_parse_sess_special_handler(span_diagnostic_handler,
856855
cm);
857-
let cstore = @mut CStore::new(token::get_ident_interner());
856+
let cstore = @mut cstore::mk_cstore(token::get_ident_interner());
858857
let filesearch = filesearch::mk_filesearch(
859858
&sopts.maybe_sysroot,
860859
sopts.target_triple,

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ fn visit_crate(e: &Env, c: &ast::Crate) {
114114
for a in c.attrs.iter().filter(|m| "link_args" == m.name()) {
115115
match a.value_str() {
116116
Some(ref linkarg) => {
117-
cstore.add_used_link_args(*linkarg);
117+
cstore::add_used_link_args(cstore, *linkarg);
118118
}
119119
None => {/* fallthrough */ }
120120
}
@@ -149,7 +149,7 @@ fn visit_view_item(e: @mut Env, i: &ast::view_item) {
149149
version,
150150
@"",
151151
i.span);
152-
e.sess.cstore.add_extern_mod_stmt_cnum(id, cnum);
152+
cstore::add_extern_mod_stmt_cnum(e.sess.cstore, id, cnum);
153153
}
154154
_ => ()
155155
}
@@ -170,7 +170,7 @@ fn visit_item(e: &Env, i: @ast::item) {
170170
for m in link_args.iter() {
171171
match m.value_str() {
172172
Some(linkarg) => {
173-
cstore.add_used_link_args(linkarg);
173+
cstore::add_used_link_args(cstore, linkarg);
174174
}
175175
None => { /* fallthrough */ }
176176
}
@@ -222,7 +222,7 @@ fn visit_item(e: &Env, i: @ast::item) {
222222
if n.is_empty() {
223223
e.sess.span_err(m.span, "#[link(name = \"\")] given with empty name");
224224
} else {
225-
cstore.add_used_library(n.to_owned(), kind);
225+
cstore::add_used_library(cstore, n.to_owned(), kind);
226226
}
227227
}
228228
None => {}
@@ -296,8 +296,8 @@ fn resolve_crate(e: @mut Env,
296296
};
297297

298298
let cstore = e.sess.cstore;
299-
cstore.set_crate_data(cnum, cmeta);
300-
cstore.add_used_crate_source(cstore::CrateSource {
299+
cstore::set_crate_data(cstore, cnum, cmeta);
300+
cstore::add_used_crate_source(cstore, cstore::CrateSource {
301301
dylib: dylib,
302302
rlib: rlib,
303303
cnum: cnum,

0 commit comments

Comments
 (0)