Skip to content

Commit 8ac482f

Browse files
committed
---
yaml --- r: 106561 b: refs/heads/try c: 1e2f572 h: refs/heads/master i: 106559: acd2a0e v: v3
1 parent 4273b01 commit 8ac482f

Some content is hidden

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

105 files changed

+1624
-2145
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: b8ef9fd9c9f642ce7b8aed82782a1ed745d08d64
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b8601a3d8b91ad3b653d143307611f2f5c75617e
5-
refs/heads/try: 910012aabae3dfd4b7190f46e88cde75804b5cb0
5+
refs/heads/try: 1e2f572fb63a37df2c1438de68b1e8cc11c75275
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/etc/mklldeps.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555

5656
f.write("#[cfg(" + ', '.join(cfg) + ")]\n")
5757

58+
# LLVM libs
5859
args = [llconfig, '--libs']
5960
args.extend(components)
6061
proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@@ -67,6 +68,21 @@
6768
for lib in out.strip().split(' '):
6869
lib = lib[2:] # chop of the leading '-l'
6970
f.write("#[link(name = \"" + lib + "\", kind = \"static\")]\n")
71+
72+
# LLVM ldflags
73+
args = [llconfig, '--ldflags']
74+
proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
75+
out, err = proc.communicate()
76+
77+
if err:
78+
print("failed to run llconfig: args = `{}`".format(args))
79+
sys.exit(1)
80+
81+
for lib in out.strip().split(' '):
82+
if lib[:2] == "-l":
83+
f.write("#[link(name = \"" + lib[2:] + "\")]\n")
84+
85+
#extra
7086
f.write("#[link(name = \"stdc++\")]\n")
7187
if os == 'win32':
7288
f.write("#[link(name = \"imagehlp\")]\n")

branches/try/src/libfourcc/lib.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,7 @@ struct Ident {
131131
}
132132

133133
fn parse_tts(cx: &ExtCtxt, tts: &[ast::TokenTree]) -> (@ast::Expr, Option<Ident>) {
134-
let p = &mut parse::new_parser_from_tts(cx.parse_sess(),
135-
cx.cfg(),
136-
tts.iter()
137-
.map(|x| (*x).clone())
138-
.collect());
134+
let p = &mut parse::new_parser_from_tts(cx.parse_sess(), cx.cfg(), tts.to_owned());
139135
let ex = p.parse_expr();
140136
let id = if p.token == token::EOF {
141137
None
@@ -155,7 +151,7 @@ fn parse_tts(cx: &ExtCtxt, tts: &[ast::TokenTree]) -> (@ast::Expr, Option<Ident>
155151
fn target_endian_little(cx: &ExtCtxt, sp: Span) -> bool {
156152
let meta = cx.meta_name_value(sp, InternedString::new("target_endian"),
157153
ast::LitStr(InternedString::new("little"), ast::CookedStr));
158-
contains(cx.cfg().as_slice(), meta)
154+
contains(cx.cfg(), meta)
159155
}
160156

161157
// FIXME (10872): This is required to prevent an LLVM assert on Windows

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ pub fn crate_id_hash(crate_id: &CrateId) -> ~str {
519519
pub fn build_link_meta(krate: &ast::Crate,
520520
output: &OutputFilenames) -> LinkMeta {
521521
let r = LinkMeta {
522-
crateid: find_crate_id(krate.attrs.as_slice(), output),
522+
crateid: find_crate_id(krate.attrs, output),
523523
crate_hash: Svh::calculate(krate),
524524
};
525525
info!("{}", r);

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

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ use std::io::fs;
3535
use std::io::MemReader;
3636
use std::os;
3737
use std::vec;
38-
use std::vec_ng::Vec;
39-
use std::vec_ng;
4038
use collections::{HashMap, HashSet};
4139
use getopts::{optopt, optmulti, optflag, optflagopt};
4240
use getopts;
@@ -103,15 +101,15 @@ pub fn default_configuration(sess: Session) ->
103101
};
104102

105103
let mk = attr::mk_name_value_item_str;
106-
return vec!(// Target bindings.
104+
return ~[ // Target bindings.
107105
attr::mk_word_item(fam.clone()),
108106
mk(InternedString::new("target_os"), tos),
109107
mk(InternedString::new("target_family"), fam),
110108
mk(InternedString::new("target_arch"), InternedString::new(arch)),
111109
mk(InternedString::new("target_endian"), InternedString::new(end)),
112110
mk(InternedString::new("target_word_size"),
113-
InternedString::new(wordsz))
114-
);
111+
InternedString::new(wordsz)),
112+
];
115113
}
116114

117115
pub fn append_configuration(cfg: &mut ast::CrateConfig,
@@ -121,7 +119,8 @@ pub fn append_configuration(cfg: &mut ast::CrateConfig,
121119
}
122120
}
123121

124-
pub fn build_configuration(sess: Session) -> ast::CrateConfig {
122+
pub fn build_configuration(sess: Session) ->
123+
ast::CrateConfig {
125124
// Combine the configuration requested by the session (command line) with
126125
// some default and generated configuration items
127126
let default_cfg = default_configuration(sess);
@@ -136,19 +135,15 @@ pub fn build_configuration(sess: Session) -> ast::CrateConfig {
136135
} else {
137136
InternedString::new("nogc")
138137
});
139-
return vec_ng::append(user_cfg.move_iter().collect(),
140-
default_cfg.as_slice());
138+
return vec::append(user_cfg, default_cfg);
141139
}
142140

143141
// Convert strings provided as --cfg [cfgspec] into a crate_cfg
144142
fn parse_cfgspecs(cfgspecs: ~[~str])
145143
-> ast::CrateConfig {
146144
cfgspecs.move_iter().map(|s| {
147145
let sess = parse::new_parse_sess();
148-
parse::parse_meta_from_source_str("cfgspec".to_str(),
149-
s,
150-
Vec::new(),
151-
sess)
146+
parse::parse_meta_from_source_str("cfgspec".to_str(), s, ~[], sess)
152147
}).collect::<ast::CrateConfig>()
153148
}
154149

@@ -198,9 +193,7 @@ pub fn phase_2_configure_and_expand(sess: Session,
198193
let time_passes = sess.time_passes();
199194

200195
sess.building_library.set(session::building_library(sess.opts, &krate));
201-
sess.crate_types.set(session::collect_crate_types(&sess,
202-
krate.attrs
203-
.as_slice()));
196+
sess.crate_types.set(session::collect_crate_types(&sess, krate.attrs));
204197

205198
time(time_passes, "gated feature checking", (), |_|
206199
front::feature_gate::check_crate(sess, &krate));
@@ -479,7 +472,7 @@ fn write_out_deps(sess: Session,
479472
input: &Input,
480473
outputs: &OutputFilenames,
481474
krate: &ast::Crate) -> io::IoResult<()> {
482-
let id = link::find_crate_id(krate.attrs.as_slice(), outputs);
475+
let id = link::find_crate_id(krate.attrs, outputs);
483476

484477
let mut out_filenames = ~[];
485478
for output_type in sess.opts.output_types.iter() {
@@ -553,11 +546,8 @@ pub fn compile_input(sess: Session, cfg: ast::CrateConfig, input: &Input,
553546
let loader = &mut Loader::new(sess);
554547
phase_2_configure_and_expand(sess, loader, krate)
555548
};
556-
let outputs = build_output_filenames(input,
557-
outdir,
558-
output,
559-
expanded_crate.attrs.as_slice(),
560-
sess);
549+
let outputs = build_output_filenames(input, outdir, output,
550+
expanded_crate.attrs, sess);
561551

562552
write_out_deps(sess, input, &outputs, &expanded_crate).unwrap();
563553

@@ -1190,7 +1180,7 @@ mod test {
11901180
let sessopts = build_session_options(matches);
11911181
let sess = build_session(sessopts, None);
11921182
let cfg = build_configuration(sess);
1193-
assert!((attr::contains_name(cfg.as_slice(), "test")));
1183+
assert!((attr::contains_name(cfg, "test")));
11941184
}
11951185

11961186
// When the user supplies --test and --cfg test, don't implicitly add

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ use syntax::{abi, ast, codemap};
2727
use syntax;
2828

2929
use std::cell::{Cell, RefCell};
30-
use std::vec_ng::Vec;
3130
use collections::{HashMap,HashSet};
3231

3332
pub struct Config {
@@ -320,7 +319,7 @@ pub fn basic_options() -> @Options {
320319
addl_lib_search_paths: @RefCell::new(HashSet::new()),
321320
maybe_sysroot: None,
322321
target_triple: host_triple(),
323-
cfg: Vec::new(),
322+
cfg: ~[],
324323
test: false,
325324
parse_only: false,
326325
no_trans: false,
@@ -452,8 +451,7 @@ pub fn building_library(options: &Options, krate: &ast::Crate) -> bool {
452451
CrateTypeStaticlib | CrateTypeDylib | CrateTypeRlib => return true
453452
}
454453
}
455-
match syntax::attr::first_attr_value_str_by_name(krate.attrs.as_slice(),
456-
"crate_type") {
454+
match syntax::attr::first_attr_value_str_by_name(krate.attrs, "crate_type") {
457455
Some(s) => {
458456
s.equiv(&("lib")) ||
459457
s.equiv(&("rlib")) ||

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct Context<'a> {
2121
// any items that do not belong in the current configuration
2222
pub fn strip_unconfigured_items(krate: ast::Crate) -> ast::Crate {
2323
let config = krate.config.clone();
24-
strip_items(krate, |attrs| in_cfg(config.as_slice(), attrs))
24+
strip_items(krate, |attrs| in_cfg(config, attrs))
2525
}
2626

2727
impl<'a> fold::Folder for Context<'a> {
@@ -117,7 +117,7 @@ fn fold_item_underscore(cx: &mut Context, item: &ast::Item_) -> ast::Item_ {
117117
ast::ItemEnum(ref def, ref generics) => {
118118
let mut variants = def.variants.iter().map(|c| c.clone()).
119119
filter_map(|v| {
120-
if !(cx.in_cfg)(v.node.attrs.as_slice()) {
120+
if !(cx.in_cfg)(v.node.attrs) {
121121
None
122122
} else {
123123
Some(match v.node.kind {
@@ -147,7 +147,7 @@ fn fold_item_underscore(cx: &mut Context, item: &ast::Item_) -> ast::Item_ {
147147

148148
fn fold_struct(cx: &Context, def: &ast::StructDef) -> @ast::StructDef {
149149
let mut fields = def.fields.iter().map(|c| c.clone()).filter(|m| {
150-
(cx.in_cfg)(m.node.attrs.as_slice())
150+
(cx.in_cfg)(m.node.attrs)
151151
});
152152
@ast::StructDef {
153153
fields: fields.collect(),
@@ -189,25 +189,25 @@ fn fold_block(cx: &mut Context, b: ast::P<ast::Block>) -> ast::P<ast::Block> {
189189
}
190190

191191
fn item_in_cfg(cx: &Context, item: &ast::Item) -> bool {
192-
return (cx.in_cfg)(item.attrs.as_slice());
192+
return (cx.in_cfg)(item.attrs);
193193
}
194194

195195
fn foreign_item_in_cfg(cx: &Context, item: &ast::ForeignItem) -> bool {
196-
return (cx.in_cfg)(item.attrs.as_slice());
196+
return (cx.in_cfg)(item.attrs);
197197
}
198198

199199
fn view_item_in_cfg(cx: &Context, item: &ast::ViewItem) -> bool {
200-
return (cx.in_cfg)(item.attrs.as_slice());
200+
return (cx.in_cfg)(item.attrs);
201201
}
202202

203203
fn method_in_cfg(cx: &Context, meth: &ast::Method) -> bool {
204-
return (cx.in_cfg)(meth.attrs.as_slice());
204+
return (cx.in_cfg)(meth.attrs);
205205
}
206206

207207
fn trait_method_in_cfg(cx: &Context, meth: &ast::TraitMethod) -> bool {
208208
match *meth {
209-
ast::Required(ref meth) => (cx.in_cfg)(meth.attrs.as_slice()),
210-
ast::Provided(meth) => (cx.in_cfg)(meth.attrs.as_slice())
209+
ast::Required(ref meth) => (cx.in_cfg)(meth.attrs),
210+
ast::Provided(meth) => (cx.in_cfg)(meth.attrs)
211211
}
212212
}
213213

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl Visitor<()> for Context {
171171
}
172172

173173
ast::ItemForeignMod(..) => {
174-
if attr::contains_name(i.attrs.as_slice(), "link_args") {
174+
if attr::contains_name(i.attrs, "link_args") {
175175
self.gate_feature("link_args", i.span,
176176
"the `link_args` attribute is not portable \
177177
across platforms, it is recommended to \
@@ -180,15 +180,15 @@ impl Visitor<()> for Context {
180180
}
181181

182182
ast::ItemFn(..) => {
183-
if attr::contains_name(i.attrs.as_slice(), "macro_registrar") {
183+
if attr::contains_name(i.attrs, "macro_registrar") {
184184
self.gate_feature("macro_registrar", i.span,
185185
"cross-crate macro exports are \
186186
experimental and possibly buggy");
187187
}
188188
}
189189

190190
ast::ItemStruct(..) => {
191-
if attr::contains_name(i.attrs.as_slice(), "simd") {
191+
if attr::contains_name(i.attrs, "simd") {
192192
self.gate_feature("simd", i.span,
193193
"SIMD types are experimental and possibly buggy");
194194
}

0 commit comments

Comments
 (0)