Skip to content

Commit 98b9eba

Browse files
MaikKleinarielb1
authored andcommitted
Rename TransItemCollectionMode to MonoItemCollectionMode
1 parent 1181f45 commit 98b9eba

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/librustc_mir/monomorphize/collector.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ use rustc_data_structures::bitvec::BitVector;
214214
use syntax::attr;
215215

216216
#[derive(PartialEq, Eq, Hash, Clone, Copy, Debug)]
217-
pub enum TransItemCollectionMode {
217+
pub enum MonoItemCollectionMode {
218218
Eager,
219219
Lazy
220220
}
@@ -296,7 +296,7 @@ impl<'tcx> InliningMap<'tcx> {
296296
}
297297

298298
pub fn collect_crate_translation_items<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
299-
mode: TransItemCollectionMode)
299+
mode: MonoItemCollectionMode)
300300
-> (FxHashSet<MonoItem<'tcx>>,
301301
InliningMap<'tcx>) {
302302
let roots = collect_roots(tcx, mode);
@@ -320,7 +320,7 @@ pub fn collect_crate_translation_items<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
320320
// Find all non-generic items by walking the HIR. These items serve as roots to
321321
// start monomorphizing from.
322322
fn collect_roots<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
323-
mode: TransItemCollectionMode)
323+
mode: MonoItemCollectionMode)
324324
-> Vec<MonoItem<'tcx>> {
325325
debug!("Collecting roots");
326326
let mut roots = Vec::new();
@@ -880,7 +880,7 @@ fn create_trans_items_for_vtable_methods<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
880880

881881
struct RootCollector<'b, 'a: 'b, 'tcx: 'a + 'b> {
882882
tcx: TyCtxt<'a, 'tcx, 'tcx>,
883-
mode: TransItemCollectionMode,
883+
mode: MonoItemCollectionMode,
884884
output: &'b mut Vec<MonoItem<'tcx>>,
885885
entry_fn: Option<DefId>,
886886
}
@@ -900,7 +900,7 @@ impl<'b, 'a, 'v> ItemLikeVisitor<'v> for RootCollector<'b, 'a, 'v> {
900900
}
901901

902902
hir::ItemImpl(..) => {
903-
if self.mode == TransItemCollectionMode::Eager {
903+
if self.mode == MonoItemCollectionMode::Eager {
904904
create_trans_items_for_default_impls(self.tcx,
905905
item,
906906
self.output);
@@ -911,7 +911,7 @@ impl<'b, 'a, 'v> ItemLikeVisitor<'v> for RootCollector<'b, 'a, 'v> {
911911
hir::ItemStruct(_, ref generics) |
912912
hir::ItemUnion(_, ref generics) => {
913913
if !generics.is_parameterized() {
914-
if self.mode == TransItemCollectionMode::Eager {
914+
if self.mode == MonoItemCollectionMode::Eager {
915915
let def_id = self.tcx.hir.local_def_id(item.id);
916916
debug!("RootCollector: ADT drop-glue for {}",
917917
def_id_to_string(self.tcx, def_id));
@@ -979,10 +979,10 @@ impl<'b, 'a, 'v> ItemLikeVisitor<'v> for RootCollector<'b, 'a, 'v> {
979979
impl<'b, 'a, 'v> RootCollector<'b, 'a, 'v> {
980980
fn is_root(&self, def_id: DefId) -> bool {
981981
!item_has_type_parameters(self.tcx, def_id) && match self.mode {
982-
TransItemCollectionMode::Eager => {
982+
MonoItemCollectionMode::Eager => {
983983
true
984984
}
985-
TransItemCollectionMode::Lazy => {
985+
MonoItemCollectionMode::Lazy => {
986986
self.entry_fn == Some(def_id) ||
987987
self.tcx.is_exported_symbol(def_id) ||
988988
attr::contains_name(&self.tcx.get_attrs(def_id),

src/librustc_trans/base.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ use attributes;
5555
use builder::Builder;
5656
use callee;
5757
use common::{C_bool, C_bytes_in_context, C_i32, C_usize};
58-
use rustc_mir::monomorphize::collector::{self, TransItemCollectionMode};
58+
use rustc_mir::monomorphize::collector::{self, MonoItemCollectionMode};
5959
use common::{self, C_struct_in_context, C_array, CrateContext, val_ty};
6060
use consts;
6161
use context::{self, LocalCrateContext, SharedCrateContext};
@@ -1002,7 +1002,7 @@ fn collect_and_partition_translation_items<'a, 'tcx>(
10021002
let mode_string = s.to_lowercase();
10031003
let mode_string = mode_string.trim();
10041004
if mode_string == "eager" {
1005-
TransItemCollectionMode::Eager
1005+
MonoItemCollectionMode::Eager
10061006
} else {
10071007
if mode_string != "lazy" {
10081008
let message = format!("Unknown codegen-item collection mode '{}'. \
@@ -1011,10 +1011,10 @@ fn collect_and_partition_translation_items<'a, 'tcx>(
10111011
tcx.sess.warn(&message);
10121012
}
10131013

1014-
TransItemCollectionMode::Lazy
1014+
MonoItemCollectionMode::Lazy
10151015
}
10161016
}
1017-
None => TransItemCollectionMode::Lazy
1017+
None => MonoItemCollectionMode::Lazy
10181018
};
10191019

10201020
let (items, inlining_map) =

0 commit comments

Comments
 (0)