Skip to content

Commit a11cae4

Browse files
committed
---
yaml --- r: 94023 b: refs/heads/try c: f9d6fd2 h: refs/heads/master i: 94021: bcf2c75 94019: 6e76fb0 94015: 6e6eadc v: v3
1 parent 4d3b041 commit a11cae4

Some content is hidden

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

84 files changed

+826
-881
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: fc4540d23ebec95a09309f042b7992b0926f6fe1
5+
refs/heads/try: f9d6fd20a515d677e923686f2fbf4e9f2307aab1
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ CFG_PREFIX=${CFG_PREFIX%/}
607607
CFG_MANDIR=${CFG_MANDIR%/}
608608
CFG_HOST="$(echo $CFG_HOST | tr ',' ' ')"
609609
CFG_TARGET="$(echo $CFG_TARGET | tr ',' ' ')"
610-
CFG_SUPPORTED_TARGET="$(grep ^CC_*=* ${CFG_SRC_DIR}mk/platform.mk | sed -e 's/^CC_//' -e 's/\([^=]*\).*/\1/' | xargs)"
610+
CFG_SUPPORTED_TARGET="$(grep ^CC_*=* $CFG_SRC_DIR/mk/platform.mk | sed -e 's/^CC_//' -e 's/\([^=]*\).*/\1/' | xargs)"
611611

612612
# copy host-triples to target-triples so that hosts are a subset of targets
613613
V_TEMP=""

branches/try/mk/install.mk

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,8 @@ install-target-$(1)-host-$(2): LIB_DESTIN_DIR=$$(PTL$(1)$(2))
8989
install-target-$(1)-host-$(2): $$(TSREQ$$(ISTAGE)_T_$(1)_H_$(2)) $$(SREQ$$(ISTAGE)_T_$(1)_H_$(2))
9090
$$(Q)$$(call MK_INSTALL_DIR,$$(PTL$(1)$(2)))
9191
$$(Q)$$(call INSTALL_LIB,$$(STDLIB_GLOB_$(1)))
92-
$$(Q)$$(call INSTALL_LIB,$$(STDLIB_RGLOB_$(1)))
9392
$$(Q)$$(call INSTALL_LIB,$$(EXTRALIB_GLOB_$(1)))
94-
$$(Q)$$(call INSTALL_LIB,$$(EXTRALIB_RGLOB_$(1)))
9593
$$(Q)$$(call INSTALL_LIB,$$(LIBRUSTUV_GLOB_$(1)))
96-
$$(Q)$$(call INSTALL_LIB,$$(LIBRUSTUV_RGLOB_$(1)))
9794
$$(Q)$$(call INSTALL_LIB,libmorestack.a)
9895

9996
endef
@@ -105,11 +102,8 @@ install-target-$(1)-host-$(2): $$(CSREQ$$(ISTAGE)_T_$(1)_H_$(2))
105102
$$(Q)$$(call MK_INSTALL_DIR,$$(PTL$(1)$(2)))
106103
$$(Q)$$(call INSTALL_LIB,$$(CFG_RUSTLLVM_$(1)))
107104
$$(Q)$$(call INSTALL_LIB,$$(STDLIB_GLOB_$(1)))
108-
$$(Q)$$(call INSTALL_LIB,$$(STDLIB_RGLOB_$(1)))
109105
$$(Q)$$(call INSTALL_LIB,$$(EXTRALIB_GLOB_$(1)))
110-
$$(Q)$$(call INSTALL_LIB,$$(EXTRALIB_RGLOB_$(1)))
111106
$$(Q)$$(call INSTALL_LIB,$$(LIBRUSTUV_GLOB_$(1)))
112-
$$(Q)$$(call INSTALL_LIB,$$(LIBRUSTUV_RGLOB_$(1)))
113107
$$(Q)$$(call INSTALL_LIB,$$(LIBRUSTC_GLOB_$(1)))
114108
$$(Q)$$(call INSTALL_LIB,$$(LIBSYNTAX_GLOB_$(1)))
115109
$$(Q)$$(call INSTALL_LIB,$$(LIBRUSTPKG_GLOB_$(1)))
@@ -148,8 +142,11 @@ install-host: $(CSREQ$(ISTAGE)_T_$(CFG_BUILD_)_H_$(CFG_BUILD_))
148142
$(Q)$(call INSTALL,$(HB2),$(PHB),rustpkg$(X_$(CFG_BUILD)))
149143
$(Q)$(call INSTALL,$(HB2),$(PHB),rustdoc$(X_$(CFG_BUILD)))
150144
$(Q)$(call INSTALL_LIB,$(STDLIB_GLOB_$(CFG_BUILD)))
145+
$(Q)$(call INSTALL_LIB,$(STDLIB_RGLOB_$(CFG_BUILD)))
151146
$(Q)$(call INSTALL_LIB,$(EXTRALIB_GLOB_$(CFG_BUILD)))
147+
$(Q)$(call INSTALL_LIB,$(EXTRALIB_RGLOB_$(CFG_BUILD)))
152148
$(Q)$(call INSTALL_LIB,$(LIBRUSTUV_GLOB_$(CFG_BUILD)))
149+
$(Q)$(call INSTALL_LIB,$(LIBRUSTUV_RGLOB_$(CFG_BUILD)))
153150
$(Q)$(call INSTALL_LIB,$(LIBRUSTC_GLOB_$(CFG_BUILD)))
154151
$(Q)$(call INSTALL_LIB,$(LIBSYNTAX_GLOB_$(CFG_BUILD)))
155152
$(Q)$(call INSTALL_LIB,$(LIBRUSTPKG_GLOB_$(CFG_BUILD)))

branches/try/mk/llvm.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ LLVM_DEPS := $(S)/.gitmodules
1414
else
1515

1616
# This is just a rough approximation of LLVM deps
17-
LLVM_DEPS_SRC=$(call rwildcard,$(CFG_LLVM_SRC_DIR)lib,*cpp *hpp)
18-
LLVM_DEPS_INC=$(call rwildcard,$(CFG_LLVM_SRC_DIR)include,*cpp *hpp)
17+
LLVM_DEPS_SRC=$(call rwildcard,$(CFG_LLVM_SRC_DIR)/lib,*cpp *hpp)
18+
LLVM_DEPS_INC=$(call rwildcard,$(CFG_LLVM_SRC_DIR)/include,*cpp *hpp)
1919
LLVM_DEPS=$(LLVM_DEPS_SRC) $(LLVM_DEPS_INC)
2020
endif
2121

branches/try/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ ifdef CFG_UNIXY_$(1)
9898
endif
9999

100100
ifdef CFG_WINDOWSY_$(1)
101-
CFG_TESTLIB_$(1)=$$(CFG_BUILD_DIR)$$(2)/$$(strip \
101+
CFG_TESTLIB_$(1)=$$(CFG_BUILD_DIR)/$$(2)/$$(strip \
102102
$$(if $$(findstring stage0,$$(1)), \
103103
stage0/$$(CFG_LIBDIR), \
104104
$$(if $$(findstring stage1,$$(1)), \

branches/try/src/libextra/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ impl<T:Freeze + Send> RWArc<T> {
485485
// Whatever region the input reference had, it will be safe to use
486486
// the same region for the output reference. (The only 'unsafe' part
487487
// of this cast is removing the mutability.)
488-
let new_data = data;
488+
let new_data = cast::transmute_immut(data);
489489
// Downgrade ensured the token belonged to us. Just a sanity check.
490490
assert!(borrow::ref_eq(&(*state).data, new_data));
491491
// Produce new token

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

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,12 @@ pub mod write {
362362
~"-o", object.as_str().unwrap().to_owned(),
363363
assembly.as_str().unwrap().to_owned()];
364364

365-
debug!("{} '{}'", cc, args.connect("' '"));
365+
debug!("{} {}", cc, args.connect(" "));
366366
let prog = run::process_output(cc, args);
367367

368368
if !prog.status.success() {
369369
sess.err(format!("linking with `{}` failed: {}", cc, prog.status));
370-
sess.note(format!("{} arguments: '{}'", cc, args.connect("' '")));
370+
sess.note(format!("{} arguments: {}", cc, args.connect(" ")));
371371
sess.note(str::from_utf8(prog.error + prog.output));
372372
sess.abort_if_errors();
373373
}
@@ -1015,7 +1015,7 @@ fn link_rlib(sess: Session, obj_filename: &Path,
10151015
cstore::NativeStatic => {
10161016
a.add_native_library(l.as_slice());
10171017
}
1018-
cstore::NativeUnknown => {}
1018+
cstore::NativeFramework | cstore::NativeUnknown => {}
10191019
}
10201020
}
10211021
return a;
@@ -1044,8 +1044,13 @@ fn link_staticlib(sess: Session, obj_filename: &Path, out_filename: &Path) {
10441044
};
10451045
a.add_rlib(&p);
10461046
let native_libs = csearch::get_native_libraries(sess.cstore, cnum);
1047-
for lib in native_libs.iter() {
1048-
sess.warn(format!("unlinked native library: {}", *lib));
1047+
for &(kind, ref lib) in native_libs.iter() {
1048+
let name = match kind {
1049+
cstore::NativeStatic => "static library",
1050+
cstore::NativeUnknown => "library",
1051+
cstore::NativeFramework => "framework",
1052+
};
1053+
sess.warn(format!("unlinked native {}: {}", name, *lib));
10491054
}
10501055
}
10511056
}
@@ -1061,7 +1066,7 @@ fn link_natively(sess: Session, dylib: bool, obj_filename: &Path,
10611066
let mut cc_args = sess.targ_cfg.target_strs.cc_args.clone();
10621067
cc_args.push_all_move(link_args(sess, dylib, obj_filename, out_filename));
10631068
if (sess.opts.debugging_opts & session::print_link_args) != 0 {
1064-
println!("{} link args: '{}'", cc_prog, cc_args.connect("' '"));
1069+
println!("{} link args: {}", cc_prog, cc_args.connect(" "));
10651070
}
10661071

10671072
// May have not found libraries in the right formats.
@@ -1073,7 +1078,7 @@ fn link_natively(sess: Session, dylib: bool, obj_filename: &Path,
10731078

10741079
if !prog.status.success() {
10751080
sess.err(format!("linking with `{}` failed: {}", cc_prog, prog.status));
1076-
sess.note(format!("{} arguments: '{}'", cc_prog, cc_args.connect("' '")));
1081+
sess.note(format!("{} arguments: {}", cc_prog, cc_args.connect(" ")));
10771082
sess.note(str::from_utf8(prog.error + prog.output));
10781083
sess.abort_if_errors();
10791084
}
@@ -1204,8 +1209,17 @@ fn add_upstream_rust_crates(args: &mut ~[~str], sess: Session,
12041209
args.push(cratepath.as_str().unwrap().to_owned());
12051210

12061211
let libs = csearch::get_native_libraries(sess.cstore, cnum);
1207-
for lib in libs.iter() {
1208-
args.push("-l" + *lib);
1212+
for &(kind, ref lib) in libs.iter() {
1213+
match kind {
1214+
cstore::NativeUnknown => args.push("-l" + *lib),
1215+
cstore::NativeFramework => {
1216+
args.push(~"-framework");
1217+
args.push(lib.to_owned());
1218+
}
1219+
cstore::NativeStatic => {
1220+
sess.bug("statics shouldn't be propagated");
1221+
}
1222+
}
12091223
}
12101224
}
12111225
return;
@@ -1262,7 +1276,15 @@ fn add_local_native_libraries(args: &mut ~[~str], sess: Session) {
12621276
args.push("-L" + path.as_str().unwrap().to_owned());
12631277
}
12641278

1265-
for &(ref l, _) in cstore::get_used_libraries(sess.cstore).iter() {
1266-
args.push(~"-l" + *l);
1279+
for &(ref l, kind) in cstore::get_used_libraries(sess.cstore).iter() {
1280+
match kind {
1281+
cstore::NativeUnknown | cstore::NativeStatic => {
1282+
args.push("-l" + *l);
1283+
}
1284+
cstore::NativeFramework => {
1285+
args.push(~"-framework");
1286+
args.push(l.to_owned());
1287+
}
1288+
}
12671289
}
12681290
}

branches/try/src/librustc/driver/driver.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -762,13 +762,7 @@ pub fn build_session_options(binary: @str,
762762
let ar = matches.opt_str("ar");
763763
let linker = matches.opt_str("linker");
764764
let linker_args = matches.opt_strs("link-args").flat_map( |a| {
765-
a.split(' ').filter_map(|arg| {
766-
if arg.is_empty() {
767-
None
768-
} else {
769-
Some(arg.to_owned())
770-
}
771-
}).collect()
765+
a.split(' ').map(|arg| arg.to_owned()).collect()
772766
});
773767

774768
let cfg = parse_cfgspecs(matches.opt_strs("cfg"), demitter);

branches/try/src/librustc/front/config.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl<'self> fold::ast_fold for Context<'self> {
2727
fn fold_mod(&self, module: &ast::_mod) -> ast::_mod {
2828
fold_mod(self, module)
2929
}
30-
fn fold_block(&self, block: ast::P<ast::Block>) -> ast::P<ast::Block> {
30+
fn fold_block(&self, block: &ast::Block) -> ast::Block {
3131
fold_block(self, block)
3232
}
3333
fn fold_foreign_mod(&self, foreign_module: &ast::foreign_mod)
@@ -97,10 +97,10 @@ fn fold_foreign_mod(cx: &Context, nm: &ast::foreign_mod) -> ast::foreign_mod {
9797

9898
fn fold_item_underscore(cx: &Context, item: &ast::item_) -> ast::item_ {
9999
let item = match *item {
100-
ast::item_impl(ref a, ref b, c, ref methods) => {
100+
ast::item_impl(ref a, ref b, ref c, ref methods) => {
101101
let methods = methods.iter().filter(|m| method_in_cfg(cx, **m))
102102
.map(|x| *x).collect();
103-
ast::item_impl((*a).clone(), (*b).clone(), c, methods)
103+
ast::item_impl((*a).clone(), (*b).clone(), (*c).clone(), methods)
104104
}
105105
ast::item_trait(ref a, ref b, ref methods) => {
106106
let methods = methods.iter()
@@ -129,22 +129,22 @@ fn retain_stmt(cx: &Context, stmt: @ast::Stmt) -> bool {
129129
}
130130
}
131131

132-
fn fold_block(cx: &Context, b: ast::P<ast::Block>) -> ast::P<ast::Block> {
132+
fn fold_block(cx: &Context, b: &ast::Block) -> ast::Block {
133133
let resulting_stmts = b.stmts.iter()
134134
.filter(|&a| retain_stmt(cx, *a))
135135
.flat_map(|&stmt| cx.fold_stmt(stmt).move_iter())
136136
.collect();
137137
let filtered_view_items = b.view_items.iter().filter_map(|a| {
138138
filter_view_item(cx, a).map(|x| cx.fold_view_item(x))
139139
}).collect();
140-
ast::P(ast::Block {
140+
ast::Block {
141141
view_items: filtered_view_items,
142142
stmts: resulting_stmts,
143143
expr: b.expr.map(|x| cx.fold_expr(x)),
144144
id: b.id,
145145
rules: b.rules,
146146
span: b.span,
147-
})
147+
}
148148
}
149149

150150
fn item_in_cfg(cx: &Context, item: @ast::item) -> bool {

branches/try/src/librustc/metadata/common.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ pub static tag_region_param_def_def_id: uint = 0x102;
199199

200200
pub static tag_native_libraries: uint = 0x103;
201201
pub static tag_native_libraries_lib: uint = 0x104;
202+
pub static tag_native_libraries_name: uint = 0x105;
203+
pub static tag_native_libraries_kind: uint = 0x106;
202204

203205
pub struct LinkMeta {
204206
name: @str,

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

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use metadata::loader;
1818
use std::hashmap::HashMap;
1919
use syntax::ast;
2020
use std::vec;
21+
use syntax::abi;
2122
use syntax::attr;
2223
use syntax::attr::AttrMetaMethods;
2324
use syntax::codemap::{Span, dummy_sp};
@@ -191,10 +192,22 @@ fn visit_item(e: &Env, i: @ast::item) {
191192
"kind" == k.name()
192193
}).and_then(|a| a.value_str());
193194
let kind = match kind {
194-
Some(k) if "static" == k => cstore::NativeStatic,
195195
Some(k) => {
196-
e.sess.span_fatal(i.span,
197-
format!("unknown kind: `{}`", k));
196+
if "static" == k {
197+
cstore::NativeStatic
198+
} else if e.sess.targ_cfg.os == abi::OsMacos &&
199+
"framework" == k {
200+
cstore::NativeFramework
201+
} else if "framework" == k {
202+
e.sess.span_err(m.span,
203+
"native frameworks are only available \
204+
on OSX targets");
205+
cstore::NativeUnknown
206+
} else {
207+
e.sess.span_err(m.span,
208+
format!("unknown kind: `{}`", k));
209+
cstore::NativeUnknown
210+
}
198211
}
199212
None => cstore::NativeUnknown
200213
};
@@ -204,9 +217,10 @@ fn visit_item(e: &Env, i: @ast::item) {
204217
let n = match n {
205218
Some(n) => n,
206219
None => {
207-
e.sess.span_fatal(i.span,
220+
e.sess.span_err(m.span,
208221
"#[link(...)] specified without \
209222
`name = \"foo\"`");
223+
@"foo"
210224
}
211225
};
212226
cstore::add_used_library(cstore, n.to_owned(), kind);

branches/try/src/librustc/metadata/csearch.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@ pub fn get_item_visibility(cstore: @mut cstore::CStore,
263263
}
264264

265265
pub fn get_native_libraries(cstore: @mut cstore::CStore,
266-
crate_num: ast::CrateNum) -> ~[~str] {
266+
crate_num: ast::CrateNum)
267+
-> ~[(cstore::NativeLibaryKind, ~str)] {
267268
let cdata = cstore::get_crate_data(cstore, crate_num);
268269
decoder::get_native_libraries(cdata)
269270
}

branches/try/src/librustc/metadata/cstore.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ pub enum LinkagePreference {
4040
RequireStatic,
4141
}
4242

43-
#[deriving(Eq)]
43+
#[deriving(Eq, FromPrimitive)]
4444
pub enum NativeLibaryKind {
45-
NativeStatic,
46-
NativeUnknown,
45+
NativeStatic, // native static library (.a archive)
46+
NativeFramework, // OSX-specific
47+
NativeUnknown, // default way to specify a dynamic library
4748
}
4849

4950
// Where a crate came from on the local filesystem. One of these two options

branches/try/src/librustc/metadata/decoder.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,11 +1530,16 @@ pub fn get_trait_of_method(cdata: Cmd, id: ast::NodeId, tcx: ty::ctxt)
15301530
}
15311531

15321532

1533-
pub fn get_native_libraries(cdata: Cmd) -> ~[~str] {
1533+
pub fn get_native_libraries(cdata: Cmd) -> ~[(cstore::NativeLibaryKind, ~str)] {
15341534
let libraries = reader::get_doc(reader::Doc(cdata.data), tag_native_libraries);
15351535
let mut result = ~[];
15361536
reader::tagged_docs(libraries, tag_native_libraries_lib, |lib_doc| {
1537-
result.push(lib_doc.as_str());
1537+
let kind_doc = reader::get_doc(lib_doc, tag_native_libraries_kind);
1538+
let name_doc = reader::get_doc(lib_doc, tag_native_libraries_name);
1539+
let kind: cstore::NativeLibaryKind =
1540+
FromPrimitive::from_u32(reader::doc_as_u32(kind_doc)).unwrap();
1541+
let name = name_doc.as_str();
1542+
result.push((kind, name));
15381543
true
15391544
});
15401545
return result;

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ fn encode_struct_fields(ecx: &EncodeContext,
352352
fn encode_enum_variant_info(ecx: &EncodeContext,
353353
ebml_w: &mut writer::Encoder,
354354
id: NodeId,
355-
variants: &[P<variant>],
355+
variants: &[variant],
356356
path: &[ast_map::path_elt],
357357
index: @mut ~[entry<i64>],
358358
generics: &ast::Generics) {
@@ -730,7 +730,7 @@ fn encode_provided_source(ebml_w: &mut writer::Encoder,
730730
fn encode_info_for_struct(ecx: &EncodeContext,
731731
ebml_w: &mut writer::Encoder,
732732
path: &[ast_map::path_elt],
733-
fields: &[struct_field],
733+
fields: &[@struct_field],
734734
global_index: @mut ~[entry<i64>])
735735
-> ~[entry<i64>] {
736736
/* Each class has its own index, since different classes
@@ -1081,7 +1081,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
10811081
def_id.node);
10821082
}
10831083
}
1084-
item_impl(_, ref opt_trait, ty, ref ast_methods) => {
1084+
item_impl(_, ref opt_trait, ref ty, ref ast_methods) => {
10851085
// We need to encode information about the default methods we
10861086
// have inherited, so we drive this based on the impl structure.
10871087
let imp = tcx.impls.get(&def_id);
@@ -1640,10 +1640,18 @@ fn encode_native_libraries(ecx: &EncodeContext, ebml_w: &mut writer::Encoder) {
16401640
for &(ref lib, kind) in cstore::get_used_libraries(ecx.cstore).iter() {
16411641
match kind {
16421642
cstore::NativeStatic => {} // these libraries are not propagated
1643-
cstore::NativeUnknown => {
1643+
cstore::NativeFramework | cstore::NativeUnknown => {
16441644
ebml_w.start_tag(tag_native_libraries_lib);
1645+
1646+
ebml_w.start_tag(tag_native_libraries_kind);
1647+
ebml_w.writer.write_be_u32(kind as u32);
1648+
ebml_w.end_tag();
1649+
1650+
ebml_w.start_tag(tag_native_libraries_name);
16451651
ebml_w.writer.write(lib.as_bytes());
16461652
ebml_w.end_tag();
1653+
1654+
ebml_w.end_tag();
16471655
}
16481656
}
16491657
}

0 commit comments

Comments
 (0)