diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 8dc927c451b..f00830f9ec9 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -136,7 +136,6 @@ pub mod middle { pub mod recursion_limit; pub mod resolve_lifetime; pub mod stability; - pub mod trans; pub mod weak_lang_items; } diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index a83c3f29d25..0ac2c2d4de8 100644 --- a/src/librustc/mir/mod.rs +++ b/src/librustc/mir/mod.rs @@ -44,6 +44,7 @@ pub mod tcx; pub mod visit; pub mod traversal; pub mod interpret; +pub mod mono; /// Types for locals type LocalDecls<'tcx> = IndexVec>; diff --git a/src/librustc/ty/maps/mod.rs b/src/librustc/ty/maps/mod.rs index 7ba063adff4..f6dd8b6e021 100644 --- a/src/librustc/ty/maps/mod.rs +++ b/src/librustc/ty/maps/mod.rs @@ -27,7 +27,7 @@ use middle::resolve_lifetime::{ResolveLifetimes, Region, ObjectLifetimeDefault}; use middle::stability::{self, DeprecationEntry}; use middle::lang_items::{LanguageItems, LangItem}; use middle::exported_symbols::SymbolExportLevel; -use middle::trans::{CodegenUnit, Stats}; +use mir::mono::{CodegenUnit, Stats}; use mir; use session::{CompileResult, CrateDisambiguator}; use session::config::OutputFilenames; diff --git a/src/librustc_mir/monomorphize/collector.rs b/src/librustc_mir/monomorphize/collector.rs index a014a8982fc..18dd19b4d9e 100644 --- a/src/librustc_mir/monomorphize/collector.rs +++ b/src/librustc_mir/monomorphize/collector.rs @@ -195,13 +195,13 @@ use rustc::hir::map as hir_map; use rustc::hir::def_id::DefId; use rustc::middle::const_val::ConstVal; use rustc::middle::lang_items::{ExchangeMallocFnLangItem}; -use rustc::middle::trans::MonoItem; use rustc::traits; use rustc::ty::subst::Substs; use rustc::ty::{self, TypeFoldable, Ty, TyCtxt}; use rustc::ty::adjustment::CustomCoerceUnsized; use rustc::mir::{self, Location}; use rustc::mir::visit::Visitor as MirVisitor; +use rustc::mir::mono::MonoItem; use monomorphize::{self, Instance}; use rustc::util::nodemap::{FxHashSet, FxHashMap, DefIdMap}; diff --git a/src/librustc_mir/monomorphize/item.rs b/src/librustc_mir/monomorphize/item.rs index 1c174293cca..ddc1becfd7c 100644 --- a/src/librustc_mir/monomorphize/item.rs +++ b/src/librustc_mir/monomorphize/item.rs @@ -17,7 +17,6 @@ use monomorphize::Instance; use rustc::hir; use rustc::hir::def_id::DefId; -use rustc::middle::trans::Linkage; use rustc::session::config::OptLevel; use rustc::traits; use rustc::ty::{self, Ty, TyCtxt}; @@ -26,11 +25,11 @@ use syntax::ast; use syntax::attr::{self, InlineAttr}; use std::fmt::{self, Write}; use std::iter; - -pub use rustc::middle::trans::MonoItem; +use rustc::mir::mono::Linkage; +pub use rustc::mir::mono::MonoItem; pub fn linkage_by_name(name: &str) -> Option { - use rustc::middle::trans::Linkage::*; + use rustc::mir::mono::Linkage::*; // Use the names from src/llvm/docs/LangRef.rst here. Most types are only // applicable to variable declarations and may not really make sense for diff --git a/src/librustc_trans/back/symbol_names.rs b/src/librustc_trans/back/symbol_names.rs index 71f66f17dfe..825f306499a 100644 --- a/src/librustc_trans/back/symbol_names.rs +++ b/src/librustc_trans/back/symbol_names.rs @@ -101,7 +101,7 @@ use monomorphize::Instance; use trans_item::{BaseMonoItemExt, InstantiationMode}; use rustc::middle::weak_lang_items; -use rustc::middle::trans::MonoItem; +use rustc::mir::mono::MonoItem; use rustc::hir::def_id::DefId; use rustc::hir::map as hir_map; use rustc::ty::{self, Ty, TyCtxt, TypeFoldable}; diff --git a/src/librustc_trans/base.rs b/src/librustc_trans/base.rs index 1f0b9eb507c..430b8cce285 100644 --- a/src/librustc_trans/base.rs +++ b/src/librustc_trans/base.rs @@ -38,8 +38,8 @@ use llvm; use metadata; use rustc::hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; use rustc::middle::lang_items::StartFnLangItem; -use rustc::middle::trans::{Linkage, Visibility, Stats}; -use rustc::middle::cstore::EncodedMetadata; +use rustc::mir::mono::{Linkage, Visibility, Stats}; +use rustc::middle::cstore::{EncodedMetadata}; use rustc::ty::{self, Ty, TyCtxt}; use rustc::ty::layout::{self, Align, TyLayout, LayoutOf}; use rustc::ty::maps::Providers; diff --git a/src/librustc_trans/context.rs b/src/librustc_trans/context.rs index b2bb605d01b..77fdf0ee691 100644 --- a/src/librustc_trans/context.rs +++ b/src/librustc_trans/context.rs @@ -27,7 +27,7 @@ use type_::Type; use type_of::PointeeInfo; use rustc_data_structures::base_n; -use rustc::middle::trans::Stats; +use rustc::mir::mono::Stats; use rustc_data_structures::stable_hasher::StableHashingContextProvider; use rustc::session::config::{self, NoDebugInfo}; use rustc::session::Session; diff --git a/src/librustc_trans/partitioning.rs b/src/librustc_trans/partitioning.rs index 198b2af89c9..7637e444e5b 100644 --- a/src/librustc_trans/partitioning.rs +++ b/src/librustc_trans/partitioning.rs @@ -107,7 +107,7 @@ use common; use rustc::dep_graph::WorkProductId; use rustc::hir::def_id::DefId; use rustc::hir::map::DefPathData; -use rustc::middle::trans::{Linkage, Visibility}; +use rustc::mir::mono::{Linkage, Visibility}; use rustc::ty::{self, TyCtxt, InstanceDef}; use rustc::ty::item_path::characteristic_def_id_of_type; use rustc::util::nodemap::{FxHashMap, FxHashSet}; @@ -116,7 +116,7 @@ use syntax::ast::NodeId; use syntax::symbol::{Symbol, InternedString}; use trans_item::{MonoItem, BaseMonoItemExt, MonoItemExt, InstantiationMode}; -pub use rustc::middle::trans::CodegenUnit; +pub use rustc::mir::mono::CodegenUnit; pub enum PartitioningStrategy { /// Generate one codegen unit per source-level module. diff --git a/src/librustc_trans/trans_item.rs b/src/librustc_trans/trans_item.rs index f4e89478513..535c9a9bcc9 100644 --- a/src/librustc_trans/trans_item.rs +++ b/src/librustc_trans/trans_item.rs @@ -25,7 +25,7 @@ use llvm; use monomorphize::Instance; use type_of::LayoutLlvmExt; use rustc::hir; -use rustc::middle::trans::{Linkage, Visibility}; +use rustc::mir::mono::{Linkage, Visibility}; use rustc::ty::{self, TyCtxt, TypeFoldable}; use rustc::ty::layout::LayoutOf; use syntax::ast; @@ -34,7 +34,7 @@ use syntax_pos::Span; use syntax_pos::symbol::Symbol; use std::fmt; -pub use rustc::middle::trans::MonoItem; +pub use rustc::mir::mono::MonoItem; pub use rustc_mir::monomorphize::item::*; pub use rustc_mir::monomorphize::item::MonoItemExt as BaseMonoItemExt;