Skip to content

Commit d8bf025

Browse files
ericktbrson
authored andcommitted
---
yaml --- r: 4499 b: refs/heads/master c: 8b15045 h: refs/heads/master i: 4497: dcbf792 4495: 0d68fe0 v: v3
1 parent 063503f commit d8bf025

Some content is hidden

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

51 files changed

+833
-832
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 50f97cb368954937662f17b8bddab81206e4ab07
2+
refs/heads/master: 8b15045224ff1a0a051e513bc35561abee7a6f65

trunk/src/comp/back/link.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,13 @@ fn build_link_meta(sess: &session::session, c: &ast::crate, output: &str,
272272
type provided_metas =
273273
{name: option::t[str],
274274
vers: option::t[str],
275-
cmh_items: (@ast::meta_item)[]};
275+
cmh_items: [@ast::meta_item]};
276276

277277
fn provided_link_metas(sess: &session::session, c: &ast::crate) ->
278278
provided_metas {
279279
let name: option::t[str] = none;
280280
let vers: option::t[str] = none;
281-
let cmh_items: (@ast::meta_item)[] = ~[];
281+
let cmh_items: [@ast::meta_item] = ~[];
282282
let linkage_metas = attr::find_linkage_metas(c.node.attrs);
283283
attr::require_unique_names(sess, linkage_metas);
284284
for meta: @ast::meta_item in linkage_metas {
@@ -412,7 +412,7 @@ fn get_symbol_hash(ccx: &@crate_ctxt, t: &ty::t) -> str {
412412
ret hash;
413413
}
414414

415-
fn mangle(ss: &str[]) -> str {
415+
fn mangle(ss: &[str]) -> str {
416416
// Follow C++ namespace-mangling style
417417

418418
let n = "_ZN"; // Begin name-sequence.
@@ -423,14 +423,14 @@ fn mangle(ss: &str[]) -> str {
423423
ret n;
424424
}
425425

426-
fn exported_name(path: &str[], hash: &str, vers: &str) -> str {
426+
fn exported_name(path: &[str], hash: &str, vers: &str) -> str {
427427
// FIXME: versioning isn't working yet
428428

429429
ret mangle(path + ~[hash]); // + "@" + vers;
430430

431431
}
432432

433-
fn mangle_exported_name(ccx: &@crate_ctxt, path: &str[], t: &ty::t) -> str {
433+
fn mangle_exported_name(ccx: &@crate_ctxt, path: &[str], t: &ty::t) -> str {
434434
let hash = get_symbol_hash(ccx, t);
435435
ret exported_name(path, hash, ccx.link_meta.vers);
436436
}
@@ -442,12 +442,12 @@ fn mangle_internal_name_by_type_only(ccx: &@crate_ctxt, t: &ty::t, name: &str)
442442
ret mangle(~[name, s, hash]);
443443
}
444444

445-
fn mangle_internal_name_by_path_and_seq(ccx: &@crate_ctxt, path: &str[],
445+
fn mangle_internal_name_by_path_and_seq(ccx: &@crate_ctxt, path: &[str],
446446
flav: &str) -> str {
447447
ret mangle(path + ~[ccx.names.next(flav)]);
448448
}
449449

450-
fn mangle_internal_name_by_path(ccx: &@crate_ctxt, path: &str[]) -> str {
450+
fn mangle_internal_name_by_path(ccx: &@crate_ctxt, path: &[str]) -> str {
451451
ret mangle(path);
452452
}
453453

trunk/src/comp/back/upcall.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ type upcalls =
7171

7272
fn declare_upcalls(tn: type_names, tydesc_type: TypeRef,
7373
taskptr_type: TypeRef, llmod: ModuleRef) -> @upcalls {
74-
fn decl(tn: type_names, llmod: ModuleRef, name: str, tys: TypeRef[],
74+
fn decl(tn: type_names, llmod: ModuleRef, name: str, tys: [TypeRef],
7575
rv: TypeRef) -> ValueRef {
76-
let arg_tys: TypeRef[] = ~[];
76+
let arg_tys: [TypeRef] = ~[];
7777
for t: TypeRef in tys { arg_tys += ~[t]; }
7878
let fn_ty = T_fn(arg_tys, rv);
7979
ret trans::decl_cdecl_fn(llmod, "upcall_" + name, fn_ty);
@@ -87,7 +87,7 @@ fn declare_upcalls(tn: type_names, tydesc_type: TypeRef,
8787
let d = bind decl_with_taskptr(taskptr_type, tn, llmod, _, _, _);
8888
let dr = bind decl(tn, llmod, _, _, _);
8989

90-
let empty_vec: TypeRef[] = ~[];
90+
let empty_vec: [TypeRef] = ~[];
9191
ret @{grow_task: dv("grow_task", ~[T_size_t()]),
9292
log_int: dv("log_int", ~[T_i32(), T_i32()]),
9393
log_float: dv("log_float", ~[T_i32(), T_f32()]),

trunk/src/comp/driver/session.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type options =
3737
time_passes: bool,
3838
time_llvm_passes: bool,
3939
output_type: back::link::output_type,
40-
library_search_paths: str[],
40+
library_search_paths: [str],
4141
sysroot: str,
4242
cfg: ast::crate_cfg,
4343
test: bool,
@@ -46,7 +46,7 @@ type options =
4646
no_trans: bool
4747
};
4848

49-
type crate_metadata = {name: str, data: u8[]};
49+
type crate_metadata = {name: str, data: [u8]};
5050

5151
obj session(targ_cfg: @config,
5252
opts: @options,

trunk/src/comp/front/attr.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export mk_attr;
2929

3030
// From a list of crate attributes get only the meta_items that impact crate
3131
// linkage
32-
fn find_linkage_metas(attrs: &ast::attribute[]) -> (@ast::meta_item)[] {
33-
let metas: (@ast::meta_item)[] = ~[];
32+
fn find_linkage_metas(attrs: &[ast::attribute]) -> [@ast::meta_item] {
33+
let metas: [@ast::meta_item] = ~[];
3434
for attr: ast::attribute in find_attrs_by_name(attrs, "link") {
3535
alt attr.node.value.node {
3636
ast::meta_list(_, items) { metas += items; }
@@ -41,8 +41,8 @@ fn find_linkage_metas(attrs: &ast::attribute[]) -> (@ast::meta_item)[] {
4141
}
4242

4343
// Search a list of attributes and return only those with a specific name
44-
fn find_attrs_by_name(attrs: &ast::attribute[], name: ast::ident) ->
45-
ast::attribute[] {
44+
fn find_attrs_by_name(attrs: &[ast::attribute], name: ast::ident) ->
45+
[ast::attribute] {
4646
let filter =
4747
bind fn (a: &ast::attribute, name: ast::ident) ->
4848
option::t[ast::attribute] {
@@ -57,8 +57,8 @@ fn get_attr_name(attr: &ast::attribute) -> ast::ident {
5757
get_meta_item_name(@attr.node.value)
5858
}
5959

60-
fn find_meta_items_by_name(metas: &(@ast::meta_item)[], name: ast::ident) ->
61-
(@ast::meta_item)[] {
60+
fn find_meta_items_by_name(metas: &[@ast::meta_item], name: ast::ident) ->
61+
[@ast::meta_item] {
6262
let filter =
6363
bind fn (m: &@ast::meta_item, name: ast::ident) ->
6464
option::t[@ast::meta_item] {
@@ -94,7 +94,7 @@ fn get_meta_item_value_str(meta: &@ast::meta_item) -> option::t[str] {
9494
fn attr_meta(attr: &ast::attribute) -> @ast::meta_item { @attr.node.value }
9595

9696
// Get the meta_items from inside a vector of attributes
97-
fn attr_metas(attrs: &ast::attribute[]) -> (@ast::meta_item)[] {
97+
fn attr_metas(attrs: &[ast::attribute]) -> [@ast::meta_item] {
9898
let mitems = ~[];
9999
for a: ast::attribute in attrs { mitems += ~[attr_meta(a)]; }
100100
ret mitems;
@@ -121,7 +121,7 @@ fn eq(a: @ast::meta_item, b: @ast::meta_item) -> bool {
121121
}
122122
}
123123

124-
fn contains(haystack: &(@ast::meta_item)[], needle: @ast::meta_item) -> bool {
124+
fn contains(haystack: &[@ast::meta_item], needle: @ast::meta_item) -> bool {
125125
log #fmt("looking for %s",
126126
syntax::print::pprust::meta_item_to_str(*needle));
127127
for item: @ast::meta_item in haystack {
@@ -133,13 +133,13 @@ fn contains(haystack: &(@ast::meta_item)[], needle: @ast::meta_item) -> bool {
133133
ret false;
134134
}
135135

136-
fn contains_name(metas: &(@ast::meta_item)[], name: ast::ident) -> bool {
136+
fn contains_name(metas: &[@ast::meta_item], name: ast::ident) -> bool {
137137
let matches = find_meta_items_by_name(metas, name);
138138
ret ivec::len(matches) > 0u;
139139
}
140140

141141
// FIXME: This needs to sort by meta_item variant in addition to the item name
142-
fn sort_meta_items(items: &(@ast::meta_item)[]) -> (@ast::meta_item)[] {
142+
fn sort_meta_items(items: &[@ast::meta_item]) -> [@ast::meta_item] {
143143
fn lteq(ma: &@ast::meta_item, mb: &@ast::meta_item) -> bool {
144144
fn key(m: &@ast::meta_item) -> ast::ident {
145145
alt m.node {
@@ -152,18 +152,18 @@ fn sort_meta_items(items: &(@ast::meta_item)[]) -> (@ast::meta_item)[] {
152152
}
153153

154154
// This is sort of stupid here, converting to a vec of mutables and back
155-
let v: (@ast::meta_item)[mutable ] = ~[mutable ];
155+
let v: [mutable @ast::meta_item] = ~[mutable];
156156
for mi: @ast::meta_item in items { v += ~[mutable mi]; }
157157

158158
std::sort::ivector::quick_sort(lteq, v);
159159

160-
let v2: (@ast::meta_item)[] = ~[];
160+
let v2: [@ast::meta_item] = ~[];
161161
for mi: @ast::meta_item in v { v2 += ~[mi]; }
162162
ret v2;
163163
}
164164

165-
fn remove_meta_items_by_name(items: &(@ast::meta_item)[], name: str) ->
166-
(@ast::meta_item)[] {
165+
fn remove_meta_items_by_name(items: &[@ast::meta_item], name: str) ->
166+
[@ast::meta_item] {
167167

168168
let filter =
169169
bind fn (item: &@ast::meta_item, name: str) ->
@@ -177,7 +177,7 @@ fn remove_meta_items_by_name(items: &(@ast::meta_item)[], name: str) ->
177177
}
178178

179179
fn require_unique_names(sess: &session::session,
180-
metas: &(@ast::meta_item)[]) {
180+
metas: &[@ast::meta_item]) {
181181
let map = map::mk_hashmap[str, ()](str::hash, str::eq);
182182
for meta: @ast::meta_item in metas {
183183
let name = get_meta_item_name(meta);
@@ -202,7 +202,7 @@ fn mk_name_value_item(name: ast::ident, value: ast::lit) -> @ast::meta_item {
202202
ret @span(ast::meta_name_value(name, value));
203203
}
204204

205-
fn mk_list_item(name: ast::ident, items: &(@ast::meta_item)[]) ->
205+
fn mk_list_item(name: ast::ident, items: &[@ast::meta_item]) ->
206206
@ast::meta_item {
207207
ret @span(ast::meta_list(name, items));
208208
}

trunk/src/comp/front/config.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fn native_item_in_cfg(cfg: &ast::crate_cfg, item: &@ast::native_item) ->
9191

9292
// Determine if an item should be translated in the current crate
9393
// configuration based on the item's attributes
94-
fn in_cfg(cfg: &ast::crate_cfg, attrs: &ast::attribute[]) -> bool {
94+
fn in_cfg(cfg: &ast::crate_cfg, attrs: &[ast::attribute]) -> bool {
9595

9696
// The "cfg" attributes on the item
9797
let item_cfg_attrs = attr::find_attrs_by_name(attrs, "cfg");
@@ -103,9 +103,9 @@ fn in_cfg(cfg: &ast::crate_cfg, attrs: &ast::attribute[]) -> bool {
103103
// which the item is valid
104104
let item_cfg_metas =
105105
{
106-
fn extract_metas(inner_items: &(@ast::meta_item)[],
106+
fn extract_metas(inner_items: &[@ast::meta_item],
107107
cfg_item: &@ast::meta_item) ->
108-
(@ast::meta_item)[] {
108+
[@ast::meta_item] {
109109
alt cfg_item.node {
110110
ast::meta_list(name, items) {
111111
assert (name == "cfg");

trunk/src/comp/front/test.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ export modify_for_testing;
1111

1212
type node_id_gen = @fn() -> ast::node_id ;
1313

14-
type test = {path: ast::ident[], ignore: bool};
14+
type test = {path: [ast::ident], ignore: bool};
1515

1616
type test_ctxt =
1717
@{next_node_id: node_id_gen,
18-
mutable path: ast::ident[],
19-
mutable testfns: test[]};
18+
mutable path: [ast::ident],
19+
mutable testfns: [test]};
2020

2121
// Traverse the crate, collecting all the test functions, eliding any
2222
// existing main functions, and synthesizing a main test harness
@@ -139,7 +139,7 @@ mod __test {
139139
std::test::test_main(args, tests())
140140
}
141141
142-
fn tests() -> std::test::test_desc[] {
142+
fn tests() -> [std::test::test_desc] {
143143
... the list of tests in the crate ...
144144
}
145145
}
@@ -211,7 +211,7 @@ fn empty_fn_ty() -> ast::ty {
211211
ret nospan(ast::ty_fn(proto, input_ty, ret_ty, cf, constrs));
212212
}
213213

214-
// The ast::ty of std::test::test_desc[]
214+
// The ast::ty of [std::test::test_desc]
215215
fn mk_test_desc_ivec_ty(cx: &test_ctxt) -> @ast::ty {
216216
let test_desc_ty_path: ast::path =
217217
nospan({global: false,

trunk/src/comp/lib/llvm.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ obj builder(B: BuilderRef, terminated: @mutable bool,
909909
ret llvm::LLVMBuildRet(B, V);
910910
}
911911

912-
fn AggregateRet(RetVals: &ValueRef[]) -> ValueRef {
912+
fn AggregateRet(RetVals: &[ValueRef]) -> ValueRef {
913913
assert (!*terminated);
914914
*terminated = true;
915915
ret llvm::LLVMBuildAggregateRet(B, ivec::to_ptr(RetVals),
@@ -941,7 +941,7 @@ obj builder(B: BuilderRef, terminated: @mutable bool,
941941
ret llvm::LLVMBuildIndirectBr(B, Addr, NumDests);
942942
}
943943

944-
fn Invoke(Fn: ValueRef, Args: &ValueRef[], Then: BasicBlockRef,
944+
fn Invoke(Fn: ValueRef, Args: &[ValueRef], Then: BasicBlockRef,
945945
Catch: BasicBlockRef) -> ValueRef {
946946
assert (!*terminated);
947947
*terminated = true;
@@ -1151,13 +1151,13 @@ obj builder(B: BuilderRef, terminated: @mutable bool,
11511151
ret llvm::LLVMBuildStore(B, Val, Ptr);
11521152
}
11531153

1154-
fn GEP(Pointer: ValueRef, Indices: &ValueRef[]) -> ValueRef {
1154+
fn GEP(Pointer: ValueRef, Indices: &[ValueRef]) -> ValueRef {
11551155
assert (!*terminated);
11561156
ret llvm::LLVMBuildGEP(B, Pointer, ivec::to_ptr(Indices),
11571157
ivec::len(Indices), str::buf(""));
11581158
}
11591159

1160-
fn InBoundsGEP(Pointer: ValueRef, Indices: &ValueRef[]) -> ValueRef {
1160+
fn InBoundsGEP(Pointer: ValueRef, Indices: &[ValueRef]) -> ValueRef {
11611161
assert (!*terminated);
11621162
ret llvm::LLVMBuildInBoundsGEP(B, Pointer, ivec::to_ptr(Indices),
11631163
ivec::len(Indices), str::buf(""));
@@ -1289,7 +1289,7 @@ obj builder(B: BuilderRef, terminated: @mutable bool,
12891289

12901290

12911291
/* Miscellaneous instructions */
1292-
fn Phi(Ty: TypeRef, vals: &ValueRef[], bbs: &BasicBlockRef[]) ->
1292+
fn Phi(Ty: TypeRef, vals: &[ValueRef], bbs: &[BasicBlockRef]) ->
12931293
ValueRef {
12941294
assert (!*terminated);
12951295
let phi = llvm::LLVMBuildPhi(B, Ty, str::buf(""));
@@ -1299,20 +1299,20 @@ obj builder(B: BuilderRef, terminated: @mutable bool,
12991299
ret phi;
13001300
}
13011301

1302-
fn AddIncomingToPhi(phi: ValueRef, vals: &ValueRef[],
1303-
bbs: &BasicBlockRef[]) {
1302+
fn AddIncomingToPhi(phi: ValueRef, vals: &[ValueRef],
1303+
bbs: &[BasicBlockRef]) {
13041304
assert (ivec::len[ValueRef](vals) == ivec::len[BasicBlockRef](bbs));
13051305
llvm::LLVMAddIncoming(phi, ivec::to_ptr(vals), ivec::to_ptr(bbs),
13061306
ivec::len(vals));
13071307
}
13081308

1309-
fn Call(Fn: ValueRef, Args: &ValueRef[]) -> ValueRef {
1309+
fn Call(Fn: ValueRef, Args: &[ValueRef]) -> ValueRef {
13101310
assert (!*terminated);
13111311
ret llvm::LLVMBuildCall(B, Fn, ivec::to_ptr(Args), ivec::len(Args),
13121312
str::buf(""));
13131313
}
13141314

1315-
fn FastCall(Fn: ValueRef, Args: &ValueRef[]) -> ValueRef {
1315+
fn FastCall(Fn: ValueRef, Args: &[ValueRef]) -> ValueRef {
13161316
assert (!*terminated);
13171317
let v =
13181318
llvm::LLVMBuildCall(B, Fn, ivec::to_ptr(Args), ivec::len(Args),
@@ -1321,7 +1321,7 @@ obj builder(B: BuilderRef, terminated: @mutable bool,
13211321
ret v;
13221322
}
13231323

1324-
fn CallWithConv(Fn: ValueRef, Args: &ValueRef[], Conv: uint) -> ValueRef {
1324+
fn CallWithConv(Fn: ValueRef, Args: &[ValueRef], Conv: uint) -> ValueRef {
13251325
assert (!*terminated);
13261326
let v =
13271327
llvm::LLVMBuildCall(B, Fn, ivec::to_ptr(Args), ivec::len(Args),
@@ -1392,7 +1392,7 @@ obj builder(B: BuilderRef, terminated: @mutable bool,
13921392
let T: ValueRef =
13931393
llvm::LLVMGetNamedFunction(M, str::buf("llvm.trap"));
13941394
assert (T as int != 0);
1395-
let Args: ValueRef[] = ~[];
1395+
let Args: [ValueRef] = ~[];
13961396
ret llvm::LLVMBuildCall(B, T, ivec::to_ptr(Args), ivec::len(Args),
13971397
str::buf(""));
13981398
}
@@ -1447,7 +1447,7 @@ fn type_to_str(names: type_names, ty: TypeRef) -> str {
14471447
ret type_to_str_inner(names, ~[], ty);
14481448
}
14491449

1450-
fn type_to_str_inner(names: type_names, outer0: &TypeRef[], ty: TypeRef) ->
1450+
fn type_to_str_inner(names: type_names, outer0: &[TypeRef], ty: TypeRef) ->
14511451
str {
14521452

14531453
if names.type_has_name(ty) { ret names.get_name(ty); }
@@ -1456,7 +1456,7 @@ fn type_to_str_inner(names: type_names, outer0: &TypeRef[], ty: TypeRef) ->
14561456

14571457
let kind: int = llvm::LLVMGetTypeKind(ty);
14581458

1459-
fn tys_str(names: type_names, outer: &TypeRef[], tys: &TypeRef[]) -> str {
1459+
fn tys_str(names: type_names, outer: &[TypeRef], tys: &[TypeRef]) -> str {
14601460
let s: str = "";
14611461
let first: bool = true;
14621462
for t: TypeRef in tys {
@@ -1493,7 +1493,7 @@ fn type_to_str_inner(names: type_names, outer0: &TypeRef[], ty: TypeRef) ->
14931493
let s = "fn(";
14941494
let out_ty: TypeRef = llvm::LLVMGetReturnType(ty);
14951495
let n_args: uint = llvm::LLVMCountParamTypes(ty);
1496-
let args: TypeRef[] = ivec::init_elt[TypeRef](0 as TypeRef, n_args);
1496+
let args: [TypeRef] = ivec::init_elt[TypeRef](0 as TypeRef, n_args);
14971497
llvm::LLVMGetParamTypes(ty, ivec::to_ptr(args));
14981498
s += tys_str(names, outer, args);
14991499
s += ") -> ";
@@ -1505,7 +1505,7 @@ fn type_to_str_inner(names: type_names, outer0: &TypeRef[], ty: TypeRef) ->
15051505
9 {
15061506
let s: str = "{";
15071507
let n_elts: uint = llvm::LLVMCountStructElementTypes(ty);
1508-
let elts: TypeRef[] = ivec::init_elt[TypeRef](0 as TypeRef, n_elts);
1508+
let elts: [TypeRef] = ivec::init_elt[TypeRef](0 as TypeRef, n_elts);
15091509
llvm::LLVMGetStructElementTypes(ty, ivec::to_ptr(elts));
15101510
s += tys_str(names, outer, elts);
15111511
s += "}";
@@ -1552,7 +1552,7 @@ fn float_width(llt: TypeRef) -> uint {
15521552
};
15531553
}
15541554

1555-
fn fn_ty_param_tys(fn_ty: TypeRef) -> TypeRef[] {
1555+
fn fn_ty_param_tys(fn_ty: TypeRef) -> [TypeRef] {
15561556
let args = ivec::init_elt(0 as TypeRef, llvm::LLVMCountParamTypes(fn_ty));
15571557
llvm::LLVMGetParamTypes(fn_ty, ivec::to_ptr(args));
15581558
ret args;

0 commit comments

Comments
 (0)