rustdoc: Convert most passes to parallel folds
This commit is contained in:
parent
d4f57620ae
commit
1ee139ae1f
@ -27,7 +27,7 @@ fn run(
|
||||
fold_res: fold_res,
|
||||
fold_iface: fold_iface,
|
||||
fold_impl: fold_impl
|
||||
with *fold::default_seq_fold(srv)
|
||||
with *fold::default_par_fold(srv)
|
||||
});
|
||||
fold.fold_crate(fold, doc)
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ fn run(
|
||||
fold_res: fold_res,
|
||||
fold_iface: fold_iface,
|
||||
fold_impl: fold_impl
|
||||
with *fold::default_seq_fold(op)
|
||||
with *fold::default_par_fold(op)
|
||||
});
|
||||
fold.fold_crate(fold, doc)
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ fn run(
|
||||
fold_item: fold_item,
|
||||
fold_iface: fold_iface,
|
||||
fold_impl: fold_impl
|
||||
with *fold::default_seq_fold(())
|
||||
with *fold::default_par_fold(())
|
||||
});
|
||||
fold.fold_crate(fold, doc)
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ fn run(srv: astsrv::srv, doc: doc::cratedoc) -> doc::cratedoc {
|
||||
let fold = fold::fold({
|
||||
fold_item: fold_item,
|
||||
fold_mod: fold_mod
|
||||
with *fold::default_seq_fold(ctxt)
|
||||
with *fold::default_par_fold(ctxt)
|
||||
});
|
||||
fold.fold_crate(fold, doc)
|
||||
}
|
||||
@ -33,7 +33,7 @@ fn fold_mod(fold: fold::fold<ctxt>, doc: doc::moddoc) -> doc::moddoc {
|
||||
let is_topmod = doc.id() == rustc::syntax::ast::crate_node_id;
|
||||
|
||||
if !is_topmod { vec::push(fold.ctxt.path, doc.name()); }
|
||||
let doc = fold::default_seq_fold_mod(fold, doc);
|
||||
let doc = fold::default_par_fold_mod(fold, doc);
|
||||
if !is_topmod { vec::pop(fold.ctxt.path); }
|
||||
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ fn run(
|
||||
fold_res: fold_res,
|
||||
fold_iface: fold_iface,
|
||||
fold_impl: fold_impl
|
||||
with *fold::default_seq_fold(())
|
||||
with *fold::default_par_fold(())
|
||||
});
|
||||
fold.fold_crate(fold, doc)
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ fn run(
|
||||
fold_iface: fold_iface,
|
||||
fold_impl: fold_impl,
|
||||
fold_type: fold_type
|
||||
with *fold::default_seq_fold(ctxt)
|
||||
with *fold::default_par_fold(ctxt)
|
||||
});
|
||||
fold.fold_crate(fold, doc)
|
||||
}
|
||||
@ -105,7 +105,7 @@ fn fold_mod(
|
||||
_ { some(itemtag) }
|
||||
}
|
||||
}
|
||||
with fold::default_seq_fold_mod(fold, doc)
|
||||
with fold::default_par_fold_mod(fold, doc)
|
||||
};
|
||||
fold.ctxt.have_docs =
|
||||
doc.brief() != none
|
||||
|
@ -13,13 +13,13 @@ fn mk_pass() -> pass {
|
||||
fn run(srv: astsrv::srv, doc: doc::cratedoc) -> doc::cratedoc {
|
||||
let fold = fold::fold({
|
||||
fold_mod: fold_mod
|
||||
with *fold::default_seq_fold(srv)
|
||||
with *fold::default_par_fold(srv)
|
||||
});
|
||||
fold.fold_crate(fold, doc)
|
||||
}
|
||||
|
||||
fn fold_mod(fold: fold::fold<astsrv::srv>, doc: doc::moddoc) -> doc::moddoc {
|
||||
let doc = fold::default_seq_fold_mod(fold, doc);
|
||||
let doc = fold::default_par_fold_mod(fold, doc);
|
||||
{
|
||||
items: ~exported_items(fold.ctxt, doc)
|
||||
with doc
|
||||
|
@ -102,6 +102,7 @@ fn build_reexport_def_map(
|
||||
def_map: common::new_def_hash()
|
||||
};
|
||||
|
||||
// FIXME: Do a parallel fold
|
||||
let fold = fold::fold({
|
||||
fold_mod: fold_mod
|
||||
with *fold::default_seq_fold(ctxt)
|
||||
|
@ -19,7 +19,7 @@ fn run(
|
||||
) -> doc::cratedoc {
|
||||
let fold = fold::fold({
|
||||
fold_mod: fold_mod
|
||||
with *fold::default_seq_fold(lteq)
|
||||
with *fold::default_par_fold(lteq)
|
||||
});
|
||||
fold.fold_crate(fold, doc)
|
||||
}
|
||||
@ -28,7 +28,7 @@ fn fold_mod(
|
||||
fold: fold::fold<item_lteq>,
|
||||
doc: doc::moddoc
|
||||
) -> doc::moddoc {
|
||||
let doc = fold::default_seq_fold_mod(fold, doc);
|
||||
let doc = fold::default_par_fold_mod(fold, doc);
|
||||
{
|
||||
items: ~sort::merge_sort(fold.ctxt, *doc.items)
|
||||
with doc
|
||||
|
@ -23,7 +23,7 @@ fn run(
|
||||
fold_iface: fold_iface,
|
||||
fold_impl: fold_impl,
|
||||
fold_type: fold_type
|
||||
with *fold::default_seq_fold(srv)
|
||||
with *fold::default_par_fold(srv)
|
||||
});
|
||||
fold.fold_crate(fold, doc)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user