提交 17bfd749 编写于 作者: M Maik Klein 提交者: Ariel Ben-Yehuda

Rename more functions from trans to mono

上级 b9ab487a
......@@ -294,9 +294,9 @@ pub fn iter_accesses<F>(&self, mut f: F)
}
}
pub fn collect_crate_translation_items<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
mode: MonoItemCollectionMode)
-> (FxHashSet<MonoItem<'tcx>>,
pub fn collect_crate_mono_items<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
mode: MonoItemCollectionMode)
-> (FxHashSet<MonoItem<'tcx>>,
InliningMap<'tcx>) {
let roots = collect_roots(tcx, mode);
......@@ -521,10 +521,10 @@ fn visit_rvalue(&mut self, rvalue: &mir::Rvalue<'tcx>, location: Location) {
// from a fixed sized array to a slice. But we are only
// interested in things that produce a vtable.
if target_ty.is_trait() && !source_ty.is_trait() {
create_trans_items_for_vtable_methods(self.tcx,
target_ty,
source_ty,
self.output);
create_mono_items_for_vtable_methods(self.tcx,
target_ty,
source_ty,
self.output);
}
}
mir::Rvalue::Cast(mir::CastKind::ReifyFnPointer, ref operand, _) => {
......@@ -844,10 +844,10 @@ fn create_fn_trans_item<'a, 'tcx>(instance: Instance<'tcx>) -> MonoItem<'tcx> {
/// Creates a `TransItem` for each method that is referenced by the vtable for
/// the given trait/impl pair.
fn create_trans_items_for_vtable_methods<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
trait_ty: Ty<'tcx>,
impl_ty: Ty<'tcx>,
output: &mut Vec<MonoItem<'tcx>>) {
fn create_mono_items_for_vtable_methods<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
trait_ty: Ty<'tcx>,
impl_ty: Ty<'tcx>,
output: &mut Vec<MonoItem<'tcx>>) {
assert!(!trait_ty.needs_subst() && !trait_ty.has_escaping_regions() &&
!impl_ty.needs_subst() && !impl_ty.has_escaping_regions());
......@@ -900,9 +900,9 @@ fn visit_item(&mut self, item: &'v hir::Item) {
hir::ItemImpl(..) => {
if self.mode == MonoItemCollectionMode::Eager {
create_trans_items_for_default_impls(self.tcx,
item,
self.output);
create_mono_items_for_default_impls(self.tcx,
item,
self.output);
}
}
......@@ -996,9 +996,9 @@ fn item_has_type_parameters<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId
generics.parent_types as usize + generics.types.len() > 0
}
fn create_trans_items_for_default_impls<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
item: &'tcx hir::Item,
output: &mut Vec<MonoItem<'tcx>>) {
fn create_mono_items_for_default_impls<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
item: &'tcx hir::Item,
output: &mut Vec<MonoItem<'tcx>>) {
match item.node {
hir::ItemImpl(_,
_,
......
......@@ -1019,7 +1019,7 @@ fn collect_and_partition_translation_items<'a, 'tcx>(
let (items, inlining_map) =
time(time_passes, "translation item collection", || {
collector::collect_crate_translation_items(tcx, collection_mode)
collector::collect_crate_mono_items(tcx, collection_mode)
});
assert_symbols_are_distinct(tcx, items.iter());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册