提交 98b9eba3 编写于 作者: M Maik Klein 提交者: Ariel Ben-Yehuda

Rename TransItemCollectionMode to MonoItemCollectionMode

上级 1181f458
......@@ -214,7 +214,7 @@
use syntax::attr;
#[derive(PartialEq, Eq, Hash, Clone, Copy, Debug)]
pub enum TransItemCollectionMode {
pub enum MonoItemCollectionMode {
Eager,
Lazy
}
......@@ -296,7 +296,7 @@ pub fn iter_accesses<F>(&self, mut f: F)
}
pub fn collect_crate_translation_items<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
mode: TransItemCollectionMode)
mode: MonoItemCollectionMode)
-> (FxHashSet<MonoItem<'tcx>>,
InliningMap<'tcx>) {
let roots = collect_roots(tcx, mode);
......@@ -320,7 +320,7 @@ pub fn collect_crate_translation_items<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
// Find all non-generic items by walking the HIR. These items serve as roots to
// start monomorphizing from.
fn collect_roots<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
mode: TransItemCollectionMode)
mode: MonoItemCollectionMode)
-> Vec<MonoItem<'tcx>> {
debug!("Collecting roots");
let mut roots = Vec::new();
......@@ -880,7 +880,7 @@ fn create_trans_items_for_vtable_methods<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
struct RootCollector<'b, 'a: 'b, 'tcx: 'a + 'b> {
tcx: TyCtxt<'a, 'tcx, 'tcx>,
mode: TransItemCollectionMode,
mode: MonoItemCollectionMode,
output: &'b mut Vec<MonoItem<'tcx>>,
entry_fn: Option<DefId>,
}
......@@ -900,7 +900,7 @@ fn visit_item(&mut self, item: &'v hir::Item) {
}
hir::ItemImpl(..) => {
if self.mode == TransItemCollectionMode::Eager {
if self.mode == MonoItemCollectionMode::Eager {
create_trans_items_for_default_impls(self.tcx,
item,
self.output);
......@@ -911,7 +911,7 @@ fn visit_item(&mut self, item: &'v hir::Item) {
hir::ItemStruct(_, ref generics) |
hir::ItemUnion(_, ref generics) => {
if !generics.is_parameterized() {
if self.mode == TransItemCollectionMode::Eager {
if self.mode == MonoItemCollectionMode::Eager {
let def_id = self.tcx.hir.local_def_id(item.id);
debug!("RootCollector: ADT drop-glue for {}",
def_id_to_string(self.tcx, def_id));
......@@ -979,10 +979,10 @@ fn visit_impl_item(&mut self, ii: &'v hir::ImplItem) {
impl<'b, 'a, 'v> RootCollector<'b, 'a, 'v> {
fn is_root(&self, def_id: DefId) -> bool {
!item_has_type_parameters(self.tcx, def_id) && match self.mode {
TransItemCollectionMode::Eager => {
MonoItemCollectionMode::Eager => {
true
}
TransItemCollectionMode::Lazy => {
MonoItemCollectionMode::Lazy => {
self.entry_fn == Some(def_id) ||
self.tcx.is_exported_symbol(def_id) ||
attr::contains_name(&self.tcx.get_attrs(def_id),
......
......@@ -55,7 +55,7 @@
use builder::Builder;
use callee;
use common::{C_bool, C_bytes_in_context, C_i32, C_usize};
use rustc_mir::monomorphize::collector::{self, TransItemCollectionMode};
use rustc_mir::monomorphize::collector::{self, MonoItemCollectionMode};
use common::{self, C_struct_in_context, C_array, CrateContext, val_ty};
use consts;
use context::{self, LocalCrateContext, SharedCrateContext};
......@@ -1002,7 +1002,7 @@ fn collect_and_partition_translation_items<'a, 'tcx>(
let mode_string = s.to_lowercase();
let mode_string = mode_string.trim();
if mode_string == "eager" {
TransItemCollectionMode::Eager
MonoItemCollectionMode::Eager
} else {
if mode_string != "lazy" {
let message = format!("Unknown codegen-item collection mode '{}'. \
......@@ -1011,10 +1011,10 @@ fn collect_and_partition_translation_items<'a, 'tcx>(
tcx.sess.warn(&message);
}
TransItemCollectionMode::Lazy
MonoItemCollectionMode::Lazy
}
}
None => TransItemCollectionMode::Lazy
None => MonoItemCollectionMode::Lazy
};
let (items, inlining_map) =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册