mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
parent
8dc5059058
commit
e65e1716a7
@ -22,29 +22,12 @@ type env = @rec(
|
|||||||
|
|
||||||
// TODO: return something
|
// TODO: return something
|
||||||
fn load_crate(ast.ident ident, vec[str] library_search_paths) -> @() {
|
fn load_crate(ast.ident ident, vec[str] library_search_paths) -> @() {
|
||||||
auto filename = os.dylib_filename(ident);
|
|
||||||
for (str library_search_path in library_search_paths) {
|
for (str library_search_path in library_search_paths) {
|
||||||
auto path = fs.connect(library_search_path, filename);
|
auto path = fs.connect(library_search_path, ident);
|
||||||
auto pb = _str.buf(path);
|
// TODO
|
||||||
auto llmb = llvmext.LLVMRustCreateMemoryBufferWithContentsOfFile(pb);
|
|
||||||
if ((llmb as int) != 0) {
|
|
||||||
auto llof = mk_object_file(llmb);
|
|
||||||
if ((llof.llof as int) != 0) {
|
|
||||||
auto llsi = mk_section_iter(llof.llof);
|
|
||||||
while ((llvmext.LLVMIsSectionIteratorAtEnd(llof.llof,
|
|
||||||
llsi.llsi) as int) == 0) {
|
|
||||||
// TODO: check name, pass contents off.
|
|
||||||
|
|
||||||
llvmext.LLVMMoveToNextSection(llsi.llsi);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: write line number of "use" statement
|
ret @();
|
||||||
log #fmt("can't find a crate named '%s' (looked for '%s' in %s)",
|
|
||||||
ident, filename, _str.connect(library_search_paths, ", "));
|
|
||||||
fail;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fold_view_item_use(&env e, &span sp, ast.ident ident,
|
fn fold_view_item_use(&env e, &span sp, ast.ident ident,
|
||||||
|
@ -42,7 +42,6 @@ mod util {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auth driver.rustc.main = impure;
|
auth driver.rustc.main = impure;
|
||||||
auth front.creader.load_crate = unsafe;
|
|
||||||
auth middle.metadata = unsafe;
|
auth middle.metadata = unsafe;
|
||||||
auth middle.trans = unsafe;
|
auth middle.trans = unsafe;
|
||||||
auth middle.trans.copy_args_to_allocas = impure;
|
auth middle.trans.copy_args_to_allocas = impure;
|
||||||
|
Loading…
Reference in New Issue
Block a user