Skip to content

Commit f58dae5

Browse files
committed
---
yaml --- r: 3916 b: refs/heads/master c: be489ee h: refs/heads/master v: v3
1 parent 366e7ce commit f58dae5

File tree

17 files changed

+338
-337
lines changed

17 files changed

+338
-337
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 4664b67ea2d0240cf121851d6c47e72bc26222b8
2+
refs/heads/master: be489ee9e2f30d2daf1c9726536631162e21dff5

trunk/src/comp/driver/rustc.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import std::option::none;
2727
import std::str;
2828
import std::vec;
2929
import std::int;
30-
import std::io;
30+
import std::ioivec;
3131
import std::run;
3232
import std::getopts;
3333
import std::getopts::optopt;
@@ -209,19 +209,19 @@ fn pretty_print_input(session::session sess, ast::crate_cfg cfg,
209209
ann = pprust::no_ann();
210210
}
211211
}
212-
pprust::print_crate(sess.get_codemap(), crate, input,
213-
std::io::stdout(), ann);
212+
pprust::print_crate(sess.get_codemap(), crate, input, ioivec::stdout(),
213+
ann);
214214
}
215215

216216
fn version(str argv0) {
217217
auto vers = "unknown version";
218218
auto env_vers = #env("CFG_VERSION");
219219
if (str::byte_len(env_vers) != 0u) { vers = env_vers; }
220-
io::stdout().write_str(#fmt("%s %s\n", argv0, vers));
220+
ioivec::stdout().write_str(#fmt("%s %s\n", argv0, vers));
221221
}
222222

223223
fn usage(str argv0) {
224-
io::stdout().write_str(#fmt("usage: %s [options] <input>\n", argv0) +
224+
ioivec::stdout().write_str(#fmt("usage: %s [options] <input>\n", argv0) +
225225
"
226226
options:
227227
@@ -450,7 +450,7 @@ fn main(vec[str] args) {
450450
case (none[pp_mode]) {/* continue */ }
451451
}
452452
if (ls) {
453-
metadata::creader::list_file_metadata(ifile, std::io::stdout());
453+
metadata::creader::list_file_metadata(ifile, ioivec::stdout());
454454
ret;
455455
}
456456

trunk/src/comp/driver/session.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import syntax::codemap;
55
import codemap::span;
66
import syntax::ast::ty_mach;
77
import std::uint;
8-
import std::io;
98
import std::map;
109
import std::option;
1110
import std::option::some;

trunk/src/comp/metadata/creader.rs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ import util::common;
1515
import std::ivec;
1616
import std::str;
1717
import std::vec;
18-
import std::ebml;
1918
import std::fs;
20-
import std::io;
19+
import std::ioivec;
2120
import std::option;
2221
import std::option::none;
2322
import std::option::some;
@@ -88,7 +87,7 @@ fn visit_item(env e, &@ast::item i) {
8887
}
8988

9089
// A diagnostic function for dumping crate metadata to an output stream
91-
fn list_file_metadata(str path, io::writer out) {
90+
fn list_file_metadata(str path, ioivec::writer out) {
9291
alt (get_metadata_section(path)) {
9392
case (option::some(?bytes)) {
9493
decoder::list_crate_metadata(bytes, out);
@@ -99,8 +98,7 @@ fn list_file_metadata(str path, io::writer out) {
9998
}
10099
}
101100

102-
fn metadata_matches(&vec[u8] crate_data,
103-
&(@ast::meta_item)[] metas) -> bool {
101+
fn metadata_matches(&@u8[] crate_data, &(@ast::meta_item)[] metas) -> bool {
104102
auto attrs = decoder::get_crate_attributes(crate_data);
105103
auto linkage_metas = attr::find_linkage_metas(attrs);
106104

@@ -130,8 +128,8 @@ fn default_native_lib_naming(session::session sess, bool static) ->
130128

131129
fn find_library_crate(&session::session sess, &ast::ident ident,
132130
&(@ast::meta_item)[] metas,
133-
&vec[str] library_search_paths) ->
134-
option::t[tup(str, vec[u8])] {
131+
&vec[str] library_search_paths)
132+
-> option::t[tup(str, @u8[])] {
135133

136134
attr::require_unique_names(sess, metas);
137135

@@ -165,7 +163,7 @@ fn find_library_crate(&session::session sess, &ast::ident ident,
165163
fn find_library_crate_aux(&rec(str prefix, str suffix) nn, str crate_name,
166164
&(@ast::meta_item)[] metas,
167165
&vec[str] library_search_paths) ->
168-
option::t[tup(str, vec[u8])] {
166+
option::t[tup(str, @u8[])] {
169167
let str prefix = nn.prefix + crate_name;
170168
// FIXME: we could probably use a 'glob' function in std::fs but it will
171169
// be much easier to write once the unsafe module knows more about FFI
@@ -200,10 +198,10 @@ fn find_library_crate_aux(&rec(str prefix, str suffix) nn, str crate_name,
200198
ret none;
201199
}
202200

203-
fn get_metadata_section(str filename) -> option::t[vec[u8]] {
201+
fn get_metadata_section(str filename) -> option::t[@u8[]] {
204202
auto b = str::buf(filename);
205203
auto mb = llvm::LLVMRustCreateMemoryBufferWithContentsOfFile(b);
206-
if (mb as int == 0) { ret option::none[vec[u8]]; }
204+
if (mb as int == 0) { ret option::none[@u8[]]; }
207205
auto of = mk_object_file(mb);
208206
auto si = mk_section_iter(of.llof);
209207
while (llvm::LLVMIsSectionIteratorAtEnd(of.llof, si.llsi) == False) {
@@ -212,18 +210,17 @@ fn get_metadata_section(str filename) -> option::t[vec[u8]] {
212210
if (str::eq(name, x86::get_meta_sect_name())) {
213211
auto cbuf = llvm::LLVMGetSectionContents(si.llsi);
214212
auto csz = llvm::LLVMGetSectionSize(si.llsi);
215-
auto cvbuf = cbuf as vec::vbuf;
216-
ret option::some[vec[u8]](vec::vec_from_vbuf[u8](cvbuf, csz));
213+
let *u8 cvbuf = std::unsafe::reinterpret_cast(cbuf);
214+
ret option::some[@u8[]](@ivec::unsafe::from_buf(cvbuf, csz));
217215
}
218216
llvm::LLVMMoveToNextSection(si.llsi);
219217
}
220-
ret option::none[vec[u8]];
218+
ret option::none[@u8[]];
221219
}
222220

223221
fn load_library_crate(&session::session sess, span span,
224222
&ast::ident ident, &(@ast::meta_item)[] metas,
225-
&vec[str] library_search_paths)
226-
-> tup(str, vec[u8]) {
223+
&vec[str] library_search_paths) -> tup(str, @u8[]) {
227224

228225
alt (find_library_crate(sess, ident, metas, library_search_paths)) {
229226
case (some(?t)) {
@@ -266,7 +263,7 @@ fn resolve_crate(env e, ast::ident ident, (@ast::meta_item)[] metas,
266263
}
267264

268265
// Go through the crate metadata and load any crates that it references
269-
fn resolve_crate_deps(env e, &vec[u8] cdata) -> cstore::cnum_map {
266+
fn resolve_crate_deps(env e, &@u8[] cdata) -> cstore::cnum_map {
270267
log "resolving deps of external crate";
271268
// The map from crate numbers in the crate we're resolving to local crate
272269
// numbers

trunk/src/comp/metadata/csearch.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import syntax::ast;
44
import middle::ty;
5-
import std::io;
65
import std::option;
76
import driver::session;
87

trunk/src/comp/metadata/cstore.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ export get_use_stmt_cnum;
2929
// own crate numbers.
3030
type cnum_map = map::hashmap[ast::crate_num, ast::crate_num];
3131

32-
type crate_metadata = rec(str name,
33-
vec[u8] data,
34-
cnum_map cnum_map);
32+
type crate_metadata = rec(str name, @u8[] data, cnum_map cnum_map);
3533

3634
// This is a bit of an experiment at encapsulating the data in cstore. By
3735
// keeping all the data in a non-exported tag variant, it's impossible for

0 commit comments

Comments
 (0)