rustc_trans: move the contents of the trans module to top-level.

This commit is contained in:
Eduard Burtescu 2016-03-22 19:23:36 +02:00
parent 98359283a4
commit 035a645e64
68 changed files with 534 additions and 556 deletions

View File

@ -30,7 +30,7 @@ use rustc_metadata::creader::LocalCrateReader;
use rustc_metadata::cstore::CStore;
use rustc_trans::back::link;
use rustc_trans::back::write;
use rustc_trans::trans;
use rustc_trans as trans;
use rustc_typeck as typeck;
use rustc_privacy;
use rustc_plugin::registry::Registry;

View File

@ -201,23 +201,23 @@ use middle::mem_categorization as mc;
use middle::mem_categorization::Categorization;
use middle::pat_util::*;
use rustc::ty::subst::Substs;
use trans::adt;
use trans::base::*;
use trans::build::{AddCase, And, Br, CondBr, GEPi, InBoundsGEP, Load, PointerCast};
use trans::build::{Not, Store, Sub, add_comment};
use trans::build;
use trans::callee::{Callee, ArgVals};
use trans::cleanup::{self, CleanupMethods, DropHintMethods};
use trans::common::*;
use trans::consts;
use trans::datum::*;
use trans::debuginfo::{self, DebugLoc, ToDebugLoc};
use trans::expr::{self, Dest};
use trans::monomorphize;
use trans::tvec;
use trans::type_of;
use trans::Disr;
use trans::value::Value;
use adt;
use base::*;
use build::{AddCase, And, Br, CondBr, GEPi, InBoundsGEP, Load, PointerCast};
use build::{Not, Store, Sub, add_comment};
use build;
use callee::{Callee, ArgVals};
use cleanup::{self, CleanupMethods, DropHintMethods};
use common::*;
use consts;
use datum::*;
use debuginfo::{self, DebugLoc, ToDebugLoc};
use expr::{self, Dest};
use monomorphize;
use tvec;
use type_of;
use Disr;
use value::Value;
use rustc::ty::{self, Ty, TyCtxt};
use rustc::traits::ProjectionMode;
use session::config::NoDebugInfo;
@ -281,7 +281,7 @@ impl<'a, 'tcx> Opt<'a, 'tcx> {
}
fn trans<'blk>(&self, mut bcx: Block<'blk, 'tcx>) -> OptResult<'blk, 'tcx> {
use trans::consts::TrueConst::Yes;
use consts::TrueConst::Yes;
let _icx = push_ctxt("match::trans_opt");
let ccx = bcx.ccx();
match *self {

View File

@ -9,22 +9,22 @@
// except according to those terms.
use llvm::{self, ValueRef};
use trans::base;
use trans::builder::Builder;
use trans::common::{type_is_fat_ptr, BlockAndBuilder};
use trans::context::CrateContext;
use trans::cabi_x86;
use trans::cabi_x86_64;
use trans::cabi_x86_win64;
use trans::cabi_arm;
use trans::cabi_aarch64;
use trans::cabi_powerpc;
use trans::cabi_powerpc64;
use trans::cabi_mips;
use trans::cabi_asmjs;
use trans::machine::{llalign_of_min, llsize_of, llsize_of_real};
use trans::type_::Type;
use trans::type_of;
use base;
use builder::Builder;
use common::{type_is_fat_ptr, BlockAndBuilder};
use context::CrateContext;
use cabi_x86;
use cabi_x86_64;
use cabi_x86_win64;
use cabi_arm;
use cabi_aarch64;
use cabi_powerpc;
use cabi_powerpc64;
use cabi_mips;
use cabi_asmjs;
use machine::{llalign_of_min, llsize_of, llsize_of_real};
use type_::Type;
use type_of;
use rustc_front::hir;
use rustc::ty::{self, Ty};

View File

@ -53,21 +53,21 @@ use rustc::ty::{self, Ty, TyCtxt};
use syntax::ast;
use syntax::attr;
use syntax::attr::IntType;
use trans::_match;
use trans::abi::FAT_PTR_ADDR;
use trans::base::InitAlloca;
use trans::build::*;
use trans::cleanup;
use trans::cleanup::CleanupMethods;
use trans::common::*;
use trans::datum;
use trans::debuginfo::DebugLoc;
use trans::glue;
use trans::machine;
use trans::monomorphize;
use trans::type_::Type;
use trans::type_of;
use trans::value::Value;
use _match;
use abi::FAT_PTR_ADDR;
use base::InitAlloca;
use build::*;
use cleanup;
use cleanup::CleanupMethods;
use common::*;
use datum;
use debuginfo::DebugLoc;
use glue;
use machine;
use monomorphize;
use type_::Type;
use type_of;
use value::Value;
type Hint = attr::ReprAttr;

View File

@ -11,12 +11,12 @@
//! # Translation of inline assembly.
use llvm::{self, ValueRef};
use trans::base;
use trans::build::*;
use trans::common::*;
use trans::datum::{Datum, Lvalue};
use trans::type_of;
use trans::type_::Type;
use base;
use build::*;
use common::*;
use datum::{Datum, Lvalue};
use type_of;
use type_::Type;
use rustc_front::hir as ast;
use std::ffi::CString;

View File

@ -14,7 +14,7 @@ use llvm::{self, ValueRef};
use session::config::NoDebugInfo;
pub use syntax::attr::InlineAttr;
use syntax::ast;
use trans::context::CrateContext;
use context::CrateContext;
/// Mark LLVM function to use provided inline heuristic.
#[inline]

View File

@ -23,7 +23,7 @@ use session::Session;
use middle::cstore::{self, CrateStore, LinkMeta};
use middle::cstore::{LinkagePreference, NativeLibraryKind};
use middle::dependency_format::Linkage;
use trans::CrateTranslation;
use CrateTranslation;
use util::common::time;
use util::fs::fix_windows_verbatim_for_gcc;
use rustc_back::tempdir::TempDir;

View File

@ -22,7 +22,7 @@ use session::Session;
use session::config::CrateTypeDylib;
use session::config;
use syntax::ast;
use trans::CrateTranslation;
use CrateTranslation;
/// Linker abstraction used by back::link to build up the command to invoke a
/// linker.

View File

@ -97,7 +97,8 @@
//! virtually impossible. Thus, symbol hash generation exclusively relies on
//! DefPaths which are much more robust in the face of changes to the code base.
use trans::{CrateContext, Instance, gensym_name};
use common::{CrateContext, gensym_name};
use monomorphize::Instance;
use util::sha2::{Digest, Sha256};
use rustc::middle::cstore;

View File

@ -16,7 +16,7 @@ use session::config::{self, OutputType};
use llvm;
use llvm::{ModuleRef, TargetMachineRef, PassManagerRef, DiagnosticInfoRef, ContextRef};
use llvm::SMDiagnosticRef;
use trans::{CrateTranslation, ModuleTranslation};
use {CrateTranslation, ModuleTranslation};
use util::common::time;
use util::common::path2cstr;
use syntax::codemap;

View File

@ -51,46 +51,46 @@ use rustc::util::common::time;
use rustc::mir::mir_map::MirMap;
use session::config::{self, NoDebugInfo, FullDebugInfo};
use session::Session;
use trans::_match;
use trans::abi::{self, Abi, FnType};
use trans::adt;
use trans::assert_dep_graph;
use trans::attributes;
use trans::build::*;
use trans::builder::{Builder, noname};
use trans::callee::{Callee, CallArgs, ArgExprs, ArgVals};
use trans::cleanup::{self, CleanupMethods, DropHint};
use trans::closure;
use trans::common::{Block, C_bool, C_bytes_in_context, C_i32, C_int, C_uint, C_integral};
use trans::collector::{self, TransItem, TransItemState, TransItemCollectionMode};
use trans::common::{C_null, C_struct_in_context, C_u64, C_u8, C_undef};
use trans::common::{CrateContext, DropFlagHintsMap, Field, FunctionContext};
use trans::common::{Result, NodeIdAndSpan, VariantInfo};
use trans::common::{node_id_type, fulfill_obligation};
use trans::common::{type_is_immediate, type_is_zero_size, val_ty};
use trans::common;
use trans::consts;
use trans::context::SharedCrateContext;
use trans::controlflow;
use trans::datum;
use trans::debuginfo::{self, DebugLoc, ToDebugLoc};
use trans::declare;
use trans::expr;
use trans::glue;
use trans::inline;
use trans::intrinsic;
use trans::machine;
use trans::machine::{llalign_of_min, llsize_of, llsize_of_real};
use trans::meth;
use trans::mir;
use trans::monomorphize::{self, Instance};
use trans::symbol_names_test;
use trans::tvec;
use trans::type_::Type;
use trans::type_of;
use trans::type_of::*;
use trans::value::Value;
use trans::Disr;
use _match;
use abi::{self, Abi, FnType};
use adt;
use assert_dep_graph;
use attributes;
use build::*;
use builder::{Builder, noname};
use callee::{Callee, CallArgs, ArgExprs, ArgVals};
use cleanup::{self, CleanupMethods, DropHint};
use closure;
use common::{Block, C_bool, C_bytes_in_context, C_i32, C_int, C_uint, C_integral};
use collector::{self, TransItem, TransItemState, TransItemCollectionMode};
use common::{C_null, C_struct_in_context, C_u64, C_u8, C_undef};
use common::{CrateContext, DropFlagHintsMap, Field, FunctionContext};
use common::{Result, NodeIdAndSpan, VariantInfo};
use common::{node_id_type, fulfill_obligation};
use common::{type_is_immediate, type_is_zero_size, val_ty};
use common;
use consts;
use context::SharedCrateContext;
use controlflow;
use datum;
use debuginfo::{self, DebugLoc, ToDebugLoc};
use declare;
use expr;
use glue;
use inline;
use intrinsic;
use machine;
use machine::{llalign_of_min, llsize_of, llsize_of_real};
use meth;
use mir;
use monomorphize::{self, Instance};
use symbol_names_test;
use tvec;
use type_::Type;
use type_of;
use type_of::*;
use value::Value;
use Disr;
use util::common::indenter;
use util::sha2::Sha256;
use util::nodemap::{NodeMap, NodeSet};

View File

@ -10,7 +10,7 @@
use llvm;
use llvm::BasicBlockRef;
use trans::value::{Users, Value};
use value::{Users, Value};
use std::iter::{Filter, Map};
#[derive(Copy, Clone)]

View File

@ -15,13 +15,13 @@ use llvm;
use llvm::{AtomicBinOp, AtomicOrdering, SynchronizationScope, AsmDialect};
use llvm::{Opcode, IntPredicate, RealPredicate};
use llvm::{ValueRef, BasicBlockRef};
use trans::common::*;
use common::*;
use syntax::codemap::Span;
use trans::builder::Builder;
use trans::type_::Type;
use trans::value::Value;
use trans::debuginfo::DebugLoc;
use builder::Builder;
use type_::Type;
use value::Value;
use debuginfo::DebugLoc;
use libc::{c_uint, c_char};

View File

@ -14,11 +14,11 @@ use llvm;
use llvm::{AtomicBinOp, AtomicOrdering, SynchronizationScope, AsmDialect};
use llvm::{Opcode, IntPredicate, RealPredicate, False, OperandBundleDef};
use llvm::{ValueRef, BasicBlockRef, BuilderRef, ModuleRef};
use trans::base;
use trans::common::*;
use trans::machine::llalign_of_pref;
use trans::type_::Type;
use trans::value::Value;
use base;
use common::*;
use machine::llalign_of_pref;
use type_::Type;
use value::Value;
use util::nodemap::FnvHashMap;
use libc::{c_uint, c_char};

View File

@ -11,9 +11,9 @@
#![allow(non_upper_case_globals)]
use llvm::{Integer, Pointer, Float, Double, Struct, Array, Vector};
use trans::abi::{FnType, ArgType};
use trans::context::CrateContext;
use trans::type_::Type;
use abi::{FnType, ArgType};
use context::CrateContext;
use type_::Type;
use std::cmp;

View File

@ -11,9 +11,9 @@
#![allow(non_upper_case_globals)]
use llvm::{Integer, Pointer, Float, Double, Struct, Array, Vector};
use trans::abi::{FnType, ArgType};
use trans::context::CrateContext;
use trans::type_::Type;
use abi::{FnType, ArgType};
use context::CrateContext;
use type_::Type;
use std::cmp;

View File

@ -11,8 +11,8 @@
#![allow(non_upper_case_globals)]
use llvm::{Struct, Array, Attribute};
use trans::abi::{FnType, ArgType};
use trans::context::CrateContext;
use abi::{FnType, ArgType};
use context::CrateContext;
// Data layout: e-p:32:32-i64:64-v128:32:128-n32-S128

View File

@ -14,9 +14,9 @@ use libc::c_uint;
use std::cmp;
use llvm;
use llvm::{Integer, Pointer, Float, Double, Struct, Array, Vector};
use trans::abi::{ArgType, FnType};
use trans::context::CrateContext;
use trans::type_::Type;
use abi::{ArgType, FnType};
use context::CrateContext;
use type_::Type;
fn align_up_to(off: usize, a: usize) -> usize {
return (off + a - 1) / a * a;

View File

@ -11,9 +11,9 @@
use libc::c_uint;
use llvm;
use llvm::{Integer, Pointer, Float, Double, Struct, Array};
use trans::abi::{FnType, ArgType};
use trans::context::CrateContext;
use trans::type_::Type;
use abi::{FnType, ArgType};
use context::CrateContext;
use type_::Type;
use std::cmp;

View File

@ -16,9 +16,9 @@
// need to be fixed when PowerPC vector support is added.
use llvm::{Integer, Pointer, Float, Double, Struct, Array};
use trans::abi::{FnType, ArgType};
use trans::context::CrateContext;
use trans::type_::Type;
use abi::{FnType, ArgType};
use context::CrateContext;
use type_::Type;
use std::cmp;

View File

@ -9,8 +9,8 @@
// except according to those terms.
use llvm::*;
use trans::abi::FnType;
use trans::type_::Type;
use abi::FnType;
use type_::Type;
use super::common::*;
use super::machine::*;

View File

@ -16,9 +16,9 @@ use self::RegClass::*;
use llvm::{Integer, Pointer, Float, Double};
use llvm::{Struct, Array, Attribute, Vector};
use trans::abi::{ArgType, FnType};
use trans::context::CrateContext;
use trans::type_::Type;
use abi::{ArgType, FnType};
use context::CrateContext;
use type_::Type;
use std::cmp;

View File

@ -11,8 +11,8 @@
use llvm::*;
use super::common::*;
use super::machine::*;
use trans::abi::{ArgType, FnType};
use trans::type_::Type;
use abi::{ArgType, FnType};
use type_::Type;
// Win64 ABI: http://msdn.microsoft.com/en-us/library/zthk2dkh.aspx

View File

@ -27,32 +27,32 @@ use rustc::ty::subst;
use rustc::ty::subst::{Substs};
use rustc::traits;
use rustc::front::map as hir_map;
use trans::abi::{Abi, FnType};
use trans::adt;
use trans::attributes;
use trans::base;
use trans::base::*;
use trans::build::*;
use trans::cleanup;
use trans::cleanup::CleanupMethods;
use trans::closure;
use trans::common::{self, Block, Result, CrateContext, FunctionContext};
use trans::common::{C_uint, C_undef};
use trans::consts;
use trans::datum::*;
use trans::debuginfo::DebugLoc;
use trans::declare;
use trans::expr;
use trans::glue;
use trans::inline;
use trans::intrinsic;
use trans::machine::{llalign_of_min, llsize_of_store};
use trans::meth;
use trans::monomorphize::{self, Instance};
use trans::type_::Type;
use trans::type_of;
use trans::value::Value;
use trans::Disr;
use abi::{Abi, FnType};
use adt;
use attributes;
use base;
use base::*;
use build::*;
use cleanup;
use cleanup::CleanupMethods;
use closure;
use common::{self, Block, Result, CrateContext, FunctionContext};
use common::{C_uint, C_undef};
use consts;
use datum::*;
use debuginfo::DebugLoc;
use declare;
use expr;
use glue;
use inline;
use intrinsic;
use machine::{llalign_of_min, llsize_of_store};
use meth;
use monomorphize::{self, Instance};
use type_::Type;
use type_of;
use value::Value;
use Disr;
use rustc::ty::{self, Ty, TyCtxt, TypeFoldable};
use rustc_front::hir;

View File

@ -120,16 +120,16 @@ pub use self::EarlyExitLabel::*;
pub use self::Heap::*;
use llvm::{BasicBlockRef, ValueRef};
use trans::base;
use trans::build;
use trans::common;
use trans::common::{Block, FunctionContext, NodeIdAndSpan, LandingPad};
use trans::datum::{Datum, Lvalue};
use trans::debuginfo::{DebugLoc, ToDebugLoc};
use trans::glue;
use base;
use build;
use common;
use common::{Block, FunctionContext, NodeIdAndSpan, LandingPad};
use datum::{Datum, Lvalue};
use debuginfo::{DebugLoc, ToDebugLoc};
use glue;
use middle::region;
use trans::type_::Type;
use trans::value::Value;
use type_::Type;
use value::Value;
use rustc::ty::{Ty, TyCtxt};
use std::fmt;

View File

@ -14,22 +14,22 @@ use llvm::{ValueRef, get_param, get_params};
use middle::def_id::DefId;
use rustc::infer;
use rustc::traits::ProjectionMode;
use trans::abi::{Abi, FnType};
use trans::adt;
use trans::attributes;
use trans::base::*;
use trans::build::*;
use trans::callee::{self, ArgVals, Callee};
use trans::cleanup::{CleanupMethods, CustomScope, ScopeId};
use trans::common::*;
use trans::datum::{ByRef, Datum, lvalue_scratch_datum};
use trans::datum::{rvalue_scratch_datum, Rvalue};
use trans::debuginfo::{self, DebugLoc};
use trans::declare;
use trans::expr;
use trans::monomorphize::{Instance};
use trans::value::Value;
use trans::Disr;
use abi::{Abi, FnType};
use adt;
use attributes;
use base::*;
use build::*;
use callee::{self, ArgVals, Callee};
use cleanup::{CleanupMethods, CustomScope, ScopeId};
use common::*;
use datum::{ByRef, Datum, lvalue_scratch_datum};
use datum::{rvalue_scratch_datum, Rvalue};
use debuginfo::{self, DebugLoc};
use declare;
use expr;
use monomorphize::{Instance};
use value::Value;
use Disr;
use rustc::ty::{self, Ty, TyCtxt};
use session::config::FullDebugInfo;

View File

@ -207,13 +207,13 @@ use syntax::codemap::DUMMY_SP;
use syntax::errors;
use syntax::parse::token;
use trans::base::custom_coerce_unsize_info;
use trans::context::CrateContext;
use trans::common::{fulfill_obligation, normalize_and_test_predicates,
use base::custom_coerce_unsize_info;
use context::CrateContext;
use common::{fulfill_obligation, normalize_and_test_predicates,
type_is_sized};
use trans::glue;
use trans::meth;
use trans::monomorphize::{self, Instance};
use glue;
use meth;
use monomorphize::{self, Instance};
use util::nodemap::{FnvHashSet, FnvHashMap, DefIdMap};
use std::hash::{Hash, Hasher};
@ -1202,7 +1202,7 @@ pub fn push_unique_type_name<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
output.push_str("unsafe ");
}
if abi != ::trans::abi::Abi::Rust {
if abi != ::abi::Abi::Rust {
output.push_str("extern \"");
output.push_str(abi.name());
output.push_str("\" ");

View File

@ -22,21 +22,21 @@ use middle::def_id::DefId;
use rustc::infer;
use middle::lang_items::LangItem;
use rustc::ty::subst::Substs;
use trans::abi::{Abi, FnType};
use trans::base;
use trans::build;
use trans::builder::Builder;
use trans::callee::Callee;
use trans::cleanup;
use trans::consts;
use trans::datum;
use trans::debuginfo::{self, DebugLoc};
use trans::declare;
use trans::machine;
use trans::mir::CachedMir;
use trans::monomorphize;
use trans::type_::Type;
use trans::value::Value;
use abi::{Abi, FnType};
use base;
use build;
use builder::Builder;
use callee::Callee;
use cleanup;
use consts;
use datum;
use debuginfo::{self, DebugLoc};
use declare;
use machine;
use mir::CachedMir;
use monomorphize;
use type_::Type;
use value::Value;
use rustc::ty::{self, Ty, TyCtxt};
use rustc::traits::{self, SelectionContext, ProjectionMode};
use rustc::ty::fold::{TypeFolder, TypeFoldable};
@ -54,7 +54,7 @@ use syntax::codemap::{DUMMY_SP, Span};
use syntax::parse::token::InternedString;
use syntax::parse::token;
pub use trans::context::CrateContext;
pub use context::CrateContext;
/// Is the type's representation size known at compile time?
pub fn type_is_sized<'tcx>(tcx: &TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool {
@ -75,8 +75,8 @@ pub fn type_is_fat_ptr<'tcx>(cx: &TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool {
}
pub fn type_is_immediate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -> bool {
use trans::machine::llsize_of_alloc;
use trans::type_of::sizing_type_of;
use machine::llsize_of_alloc;
use type_of::sizing_type_of;
let tcx = ccx.tcx();
let simple = ty.is_scalar() ||
@ -100,8 +100,8 @@ pub fn type_is_immediate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -
/// Identify types which have size zero at runtime.
pub fn type_is_zero_size<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -> bool {
use trans::machine::llsize_of_alloc;
use trans::type_of::sizing_type_of;
use machine::llsize_of_alloc;
use type_of::sizing_type_of;
let llty = sizing_type_of(ccx, ty);
llsize_of_alloc(ccx, llty) == 0
}
@ -141,7 +141,7 @@ pub fn gensym_name(name: &str) -> ast::Name {
*
*/
use trans::Disr;
use Disr;
#[derive(Copy, Clone)]
pub struct NodeIdAndSpan {
@ -491,7 +491,7 @@ impl<'a, 'tcx> FunctionContext<'a, 'tcx> {
// Returns a ValueRef of the "eh_unwind_resume" lang item if one is defined,
// otherwise declares it as an external function.
pub fn eh_unwind_resume(&self) -> Callee<'tcx> {
use trans::attributes;
use attributes;
let ccx = self.ccx;
let tcx = ccx.tcx();
assert!(ccx.sess().target.target.options.custom_unwind_resume);

View File

@ -17,21 +17,21 @@ use middle::const_eval::{self, ConstEvalErr};
use middle::def::Def;
use middle::def_id::DefId;
use rustc::front::map as hir_map;
use trans::{abi, adt, closure, debuginfo, expr, machine};
use trans::base::{self, exported_name, imported_name, push_ctxt};
use trans::callee::Callee;
use trans::collector::{self, TransItem};
use trans::common::{type_is_sized, C_nil, const_get_elt};
use trans::common::{CrateContext, C_integral, C_floating, C_bool, C_str_slice, C_bytes, val_ty};
use trans::common::{C_struct, C_undef, const_to_opt_int, const_to_opt_uint, VariantInfo, C_uint};
use trans::common::{type_is_fat_ptr, Field, C_vector, C_array, C_null};
use trans::datum::{Datum, Lvalue};
use trans::declare;
use trans::monomorphize::{self, Instance};
use trans::type_::Type;
use trans::type_of;
use trans::value::Value;
use trans::Disr;
use {abi, adt, closure, debuginfo, expr, machine};
use base::{self, exported_name, imported_name, push_ctxt};
use callee::Callee;
use collector::{self, TransItem};
use common::{type_is_sized, C_nil, const_get_elt};
use common::{CrateContext, C_integral, C_floating, C_bool, C_str_slice, C_bytes, val_ty};
use common::{C_struct, C_undef, const_to_opt_int, const_to_opt_uint, VariantInfo, C_uint};
use common::{type_is_fat_ptr, Field, C_vector, C_array, C_null};
use datum::{Datum, Lvalue};
use declare;
use monomorphize::{self, Instance};
use type_::Type;
use type_of;
use value::Value;
use Disr;
use rustc::ty::subst::Substs;
use rustc::ty::adjustment::{AdjustDerefRef, AdjustReifyFnPointer};
use rustc::ty::adjustment::{AdjustUnsafeFnPointer, AdjustMutToConstPointer};

View File

@ -17,18 +17,18 @@ use middle::def_id::DefId;
use rustc::traits;
use rustc::mir::mir_map::MirMap;
use rustc::mir::repr as mir;
use trans::adt;
use trans::base;
use trans::builder::Builder;
use trans::common::BuilderRef_res;
use trans::debuginfo;
use trans::declare;
use trans::glue::DropGlueKind;
use trans::mir::CachedMir;
use trans::Instance;
use adt;
use base;
use builder::Builder;
use common::BuilderRef_res;
use debuginfo;
use declare;
use glue::DropGlueKind;
use mir::CachedMir;
use monomorphize::Instance;
use trans::collector::{TransItem, TransItemState};
use trans::type_::{Type, TypeNames};
use collector::{TransItem, TransItemState};
use type_::{Type, TypeNames};
use rustc::ty::subst::{Substs, VecPerParamSpace};
use rustc::ty::{self, Ty, TyCtxt};
use session::config::NoDebugInfo;

View File

@ -12,19 +12,18 @@ use llvm::ValueRef;
use middle::def::Def;
use middle::lang_items::{PanicFnLangItem, PanicBoundsCheckFnLangItem};
use rustc::ty::subst::Substs;
use trans::base::*;
use trans::basic_block::BasicBlock;
use trans::build::*;
use trans::callee::{Callee, ArgVals};
use trans::cleanup::CleanupMethods;
use trans::cleanup;
use trans::common::*;
use trans::consts;
use trans::debuginfo;
use trans::debuginfo::{DebugLoc, ToDebugLoc};
use trans::expr;
use trans::machine;
use trans;
use base::*;
use basic_block::BasicBlock;
use build::*;
use callee::{Callee, ArgVals};
use cleanup::CleanupMethods;
use cleanup;
use common::*;
use consts;
use debuginfo;
use debuginfo::{DebugLoc, ToDebugLoc};
use expr;
use machine;
use rustc_front::hir;
use rustc_front::util as ast_util;
@ -169,11 +168,11 @@ pub fn trans_if<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
if cv == 1 {
// if true { .. } [else { .. }]
bcx = trans_block(bcx, &thn, dest);
trans::debuginfo::clear_source_location(bcx.fcx);
debuginfo::clear_source_location(bcx.fcx);
} else {
if let Some(elexpr) = els {
bcx = expr::trans_into(bcx, &elexpr, dest);
trans::debuginfo::clear_source_location(bcx.fcx);
debuginfo::clear_source_location(bcx.fcx);
}
}
@ -183,7 +182,7 @@ pub fn trans_if<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
let name = format!("then-block-{}-", thn.id);
let then_bcx_in = bcx.fcx.new_id_block(&name[..], thn.id);
let then_bcx_out = trans_block(then_bcx_in, &thn, dest);
trans::debuginfo::clear_source_location(bcx.fcx);
debuginfo::clear_source_location(bcx.fcx);
let cond_source_loc = cond.debug_loc();
@ -206,7 +205,7 @@ pub fn trans_if<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
// Clear the source location because it is still set to whatever has been translated
// right before.
trans::debuginfo::clear_source_location(next_bcx.fcx);
debuginfo::clear_source_location(next_bcx.fcx);
next_bcx
}

View File

@ -93,15 +93,15 @@ pub use self::Expr::*;
pub use self::RvalueMode::*;
use llvm::ValueRef;
use trans::adt;
use trans::base::*;
use trans::build::{Load, Store};
use trans::common::*;
use trans::cleanup;
use trans::cleanup::{CleanupMethods, DropHintDatum, DropHintMethods};
use trans::expr;
use trans::tvec;
use trans::value::Value;
use adt;
use base::*;
use build::{Load, Store};
use common::*;
use cleanup;
use cleanup::{CleanupMethods, DropHintDatum, DropHintMethods};
use expr;
use tvec;
use value::Value;
use rustc::ty::Ty;
use std::fmt;

View File

@ -13,7 +13,7 @@ use super::utils::DIB;
use llvm;
use llvm::debuginfo::{DIScope, DISubprogram};
use trans::common::CrateContext;
use common::CrateContext;
use middle::pat_util;
use rustc::util::nodemap::NodeMap;

View File

@ -12,9 +12,9 @@
use llvm;
use trans::common::{C_bytes, CrateContext, C_i32};
use trans::declare;
use trans::type_::Type;
use common::{C_bytes, CrateContext, C_i32};
use declare;
use type_::Type;
use session::config::NoDebugInfo;
use std::ffi::CString;

View File

@ -29,10 +29,10 @@ use middle::pat_util;
use rustc::ty::subst;
use rustc::front::map as hir_map;
use rustc_front::hir::{self, PatKind};
use trans::{type_of, adt, machine, monomorphize};
use trans::common::{self, CrateContext, FunctionContext, Block};
use trans::_match::{BindingInfo, TransBindingMode};
use trans::type_::Type;
use {type_of, adt, machine, monomorphize};
use common::{self, CrateContext, FunctionContext, Block};
use _match::{BindingInfo, TransBindingMode};
use type_::Type;
use rustc::ty::{self, Ty};
use session::config::{self, FullDebugInfo};
use util::nodemap::FnvHashMap;

View File

@ -32,10 +32,9 @@ use rustc::ty::subst::{self, Substs};
use rustc_front;
use rustc_front::hir;
use trans::abi::Abi;
use trans::common::{NodeIdAndSpan, CrateContext, FunctionContext, Block};
use trans;
use trans::monomorphize;
use abi::Abi;
use common::{NodeIdAndSpan, CrateContext, FunctionContext, Block};
use monomorphize;
use rustc::infer;
use rustc::ty::{self, Ty};
use session::config::{self, FullDebugInfo, LimitedDebugInfo, NoDebugInfo};
@ -632,7 +631,7 @@ fn declare_local<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
debug_loc,
bcx.llbb);
llvm::LLVMSetInstDebugLocation(trans::build::B(bcx).llbuilder, instr);
llvm::LLVMSetInstDebugLocation(::build::B(bcx).llbuilder, instr);
}
}
}

View File

@ -16,7 +16,7 @@ use llvm;
use llvm::debuginfo::DIScope;
use rustc::middle::def_id::DefId;
use rustc::front::map as hir_map;
use trans::common::CrateContext;
use common::CrateContext;
use std::ffi::CString;
use std::ptr;

View File

@ -16,7 +16,7 @@ use super::{FunctionDebugContext, DebugLoc};
use llvm;
use llvm::debuginfo::DIScope;
use trans::common::{NodeIdAndSpan, CrateContext, FunctionContext};
use common::{NodeIdAndSpan, CrateContext, FunctionContext};
use libc::c_uint;
use std::ptr;

View File

@ -12,7 +12,7 @@
use super::namespace::crate_root_namespace;
use trans::common::CrateContext;
use common::CrateContext;
use middle::def_id::DefId;
use rustc::infer;
use rustc::ty::subst;
@ -107,7 +107,7 @@ pub fn push_debuginfo_type_name<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
output.push_str("unsafe ");
}
if abi != ::trans::abi::Abi::Rust {
if abi != ::abi::Abi::Rust {
output.push_str("extern \"");
output.push_str(abi.name());
output.push_str("\" ");

View File

@ -17,9 +17,9 @@ use middle::def_id::DefId;
use llvm;
use llvm::debuginfo::{DIScope, DIBuilderRef, DIDescriptor, DIArray};
use trans::machine;
use trans::common::{CrateContext, FunctionContext};
use trans::type_::Type;
use machine;
use common::{CrateContext, FunctionContext};
use type_::Type;
use syntax::codemap::Span;
use syntax::{ast, codemap};

View File

@ -22,10 +22,10 @@
use llvm::{self, ValueRef};
use rustc::ty;
use rustc::infer;
use trans::abi::{Abi, FnType};
use trans::attributes;
use trans::context::CrateContext;
use trans::type_::Type;
use abi::{Abi, FnType};
use attributes;
use context::CrateContext;
use type_::Type;
use std::ffi::CString;
use libc::c_uint;

View File

@ -55,21 +55,21 @@ use llvm::{self, ValueRef, TypeKind};
use middle::const_qualif::ConstQualif;
use middle::def::Def;
use rustc::ty::subst::Substs;
use trans::{_match, abi, adt, asm, base, closure, consts, controlflow};
use trans::base::*;
use trans::build::*;
use trans::callee::{Callee, ArgExprs, ArgOverloadedCall, ArgOverloadedOp};
use trans::cleanup::{self, CleanupMethods, DropHintMethods};
use trans::common::*;
use trans::datum::*;
use trans::debuginfo::{self, DebugLoc, ToDebugLoc};
use trans::declare;
use trans::glue;
use trans::machine;
use trans::tvec;
use trans::type_of;
use trans::value::Value;
use trans::Disr;
use {_match, abi, adt, asm, base, closure, consts, controlflow};
use base::*;
use build::*;
use callee::{Callee, ArgExprs, ArgOverloadedCall, ArgOverloadedOp};
use cleanup::{self, CleanupMethods, DropHintMethods};
use common::*;
use datum::*;
use debuginfo::{self, DebugLoc, ToDebugLoc};
use declare;
use glue;
use machine;
use tvec;
use type_of;
use value::Value;
use Disr;
use rustc::ty::adjustment::{AdjustDerefRef, AdjustReifyFnPointer};
use rustc::ty::adjustment::{AdjustUnsafeFnPointer, AdjustMutToConstPointer};
use rustc::ty::adjustment::CustomCoerceUnsized;
@ -77,8 +77,8 @@ use rustc::ty::{self, Ty, TyCtxt};
use rustc::ty::MethodCall;
use rustc::ty::cast::{CastKind, CastTy};
use util::common::indenter;
use trans::machine::{llsize_of, llsize_of_alloc};
use trans::type_::Type;
use machine::{llsize_of, llsize_of_alloc};
use type_::Type;
use rustc_front;
use rustc_front::hir;

View File

@ -21,24 +21,24 @@ use middle::lang_items::ExchangeFreeFnLangItem;
use rustc::ty::subst::{Substs};
use rustc::traits;
use rustc::ty::{self, Ty, TyCtxt};
use trans::abi::{Abi, FnType};
use trans::adt;
use trans::adt::GetDtorType; // for tcx.dtor_type()
use trans::base::*;
use trans::build::*;
use trans::callee::{Callee, ArgVals};
use trans::cleanup;
use trans::cleanup::CleanupMethods;
use trans::collector::{self, TransItem};
use trans::common::*;
use trans::debuginfo::DebugLoc;
use trans::declare;
use trans::expr;
use trans::machine::*;
use trans::monomorphize;
use trans::type_of::{type_of, sizing_type_of, align_of};
use trans::type_::Type;
use trans::value::Value;
use abi::{Abi, FnType};
use adt;
use adt::GetDtorType; // for tcx.dtor_type()
use base::*;
use build::*;
use callee::{Callee, ArgVals};
use cleanup;
use cleanup::CleanupMethods;
use collector::{self, TransItem};
use common::*;
use debuginfo::DebugLoc;
use declare;
use expr;
use machine::*;
use monomorphize;
use type_of::{type_of, sizing_type_of, align_of};
use type_::Type;
use value::Value;
use arena::TypedArena;
use syntax::codemap::DUMMY_SP;

View File

@ -12,9 +12,9 @@ use llvm::{AvailableExternallyLinkage, InternalLinkage, SetLinkage};
use middle::cstore::{CrateStore, FoundAst, InlinedItem};
use middle::def_id::DefId;
use rustc::ty::subst::Substs;
use trans::base::{push_ctxt, trans_item, trans_fn};
use trans::callee::Callee;
use trans::common::*;
use base::{push_ctxt, trans_item, trans_fn};
use callee::Callee;
use common::*;
use rustc::dep_graph::DepNode;
use rustc_front::hir;

View File

@ -18,26 +18,26 @@ use llvm::{ValueRef, TypeKind};
use rustc::infer;
use rustc::ty::subst;
use rustc::ty::subst::FnSpace;
use trans::abi::{Abi, FnType};
use trans::adt;
use trans::attributes;
use trans::base::*;
use trans::build::*;
use trans::callee::{self, Callee};
use trans::cleanup;
use trans::cleanup::CleanupMethods;
use trans::common::*;
use trans::consts;
use trans::datum::*;
use trans::debuginfo::DebugLoc;
use trans::declare;
use trans::expr;
use trans::glue;
use trans::type_of;
use trans::machine;
use trans::type_::Type;
use abi::{Abi, FnType};
use adt;
use attributes;
use base::*;
use build::*;
use callee::{self, Callee};
use cleanup;
use cleanup::CleanupMethods;
use common::*;
use consts;
use datum::*;
use debuginfo::DebugLoc;
use declare;
use expr;
use glue;
use type_of;
use machine;
use type_::Type;
use rustc::ty::{self, Ty, TypeFoldable};
use trans::Disr;
use Disr;
use rustc::ty::subst::Substs;
use rustc::dep_graph::DepNode;
use rustc_front::hir;

View File

@ -61,6 +61,9 @@ pub use rustc::middle;
pub use rustc::lint;
pub use rustc::util;
pub use base::trans_crate;
pub use disr::Disr;
pub mod back {
pub use rustc_back::rpath;
pub use rustc_back::svh;
@ -76,10 +79,70 @@ pub mod back {
pub mod diagnostics;
pub mod trans;
#[macro_use]
mod macros;
pub mod lib {
pub use llvm;
mod abi;
mod adt;
mod asm;
mod assert_dep_graph;
mod attributes;
mod base;
mod basic_block;
mod build;
mod builder;
mod cabi_aarch64;
mod cabi_arm;
mod cabi_asmjs;
mod cabi_mips;
mod cabi_powerpc;
mod cabi_powerpc64;
mod cabi_x86;
mod cabi_x86_64;
mod cabi_x86_win64;
mod callee;
mod cleanup;
mod closure;
mod common;
mod consts;
mod context;
mod controlflow;
mod datum;
mod debuginfo;
mod declare;
mod disr;
mod expr;
mod glue;
mod inline;
mod intrinsic;
mod machine;
mod _match;
mod meth;
mod mir;
mod monomorphize;
mod collector;
mod symbol_names_test;
mod tvec;
mod type_;
mod type_of;
mod value;
#[derive(Copy, Clone)]
pub struct ModuleTranslation {
pub llcx: llvm::ContextRef,
pub llmod: llvm::ModuleRef,
}
unsafe impl Send for ModuleTranslation { }
unsafe impl Sync for ModuleTranslation { }
pub struct CrateTranslation {
pub modules: Vec<ModuleTranslation>,
pub metadata_module: ModuleTranslation,
pub link: middle::cstore::LinkMeta,
pub metadata: Vec<u8>,
pub reachable: Vec<String>,
pub no_builtins: bool,
}
__build_diagnostic_array! { librustc_trans, DIAGNOSTICS }

View File

@ -13,9 +13,9 @@
#![allow(non_camel_case_types)]
use llvm::{self, ValueRef};
use trans::common::*;
use common::*;
use trans::type_::Type;
use type_::Type;
pub type llbits = u64;
pub type llsize = u64;

View File

@ -18,21 +18,21 @@ use rustc::infer;
use rustc::ty::subst::{FnSpace, Subst, Substs};
use rustc::ty::subst;
use rustc::traits::{self, ProjectionMode};
use trans::abi::FnType;
use trans::base::*;
use trans::build::*;
use trans::callee::{Callee, Virtual, ArgVals, trans_fn_pointer_shim};
use trans::closure;
use trans::common::*;
use trans::consts;
use trans::debuginfo::DebugLoc;
use trans::declare;
use trans::expr;
use trans::glue;
use trans::machine;
use trans::type_::Type;
use trans::type_of::*;
use trans::value::Value;
use abi::FnType;
use base::*;
use build::*;
use callee::{Callee, Virtual, ArgVals, trans_fn_pointer_shim};
use closure;
use common::*;
use consts;
use debuginfo::DebugLoc;
use declare;
use expr;
use glue;
use machine;
use type_::Type;
use type_of::*;
use value::Value;
use rustc::ty::{self, Ty, TyCtxt, TypeFoldable};
use syntax::ast::Name;

View File

@ -14,7 +14,7 @@
use rustc_data_structures::bitvec::BitVector;
use rustc::mir::repr as mir;
use rustc::mir::visit::{Visitor, LvalueContext};
use trans::common::{self, Block};
use common::{self, Block};
use super::rvalue;
pub fn lvalue_temps<'bcx,'tcx>(bcx: Block<'bcx,'tcx>,

View File

@ -11,19 +11,19 @@
use llvm::{self, BasicBlockRef, ValueRef, OperandBundleDef};
use rustc::ty;
use rustc::mir::repr as mir;
use trans::abi::{Abi, FnType};
use trans::adt;
use trans::base;
use trans::build;
use trans::callee::{Callee, CalleeData, Fn, Intrinsic, NamedTupleConstructor, Virtual};
use trans::common::{self, Block, BlockAndBuilder, C_undef};
use trans::debuginfo::DebugLoc;
use trans::Disr;
use trans::machine::{llalign_of_min, llbitsize_of_real};
use trans::meth;
use trans::type_of;
use trans::glue;
use trans::type_::Type;
use abi::{Abi, FnType};
use adt;
use base;
use build;
use callee::{Callee, CalleeData, Fn, Intrinsic, NamedTupleConstructor, Virtual};
use common::{self, Block, BlockAndBuilder, C_undef};
use debuginfo::DebugLoc;
use Disr;
use machine::{llalign_of_min, llbitsize_of_real};
use meth;
use type_of;
use glue;
use type_::Type;
use super::{MirContext, drop};
use super::lvalue::{LvalueRef, load_fat_ptr};
@ -265,9 +265,9 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
callee.reify(bcx.ccx()).val
}
Intrinsic => {
use trans::callee::ArgVals;
use trans::expr::{Ignore, SaveIn};
use trans::intrinsic::trans_intrinsic_call;
use callee::ArgVals;
use expr::{Ignore, SaveIn};
use intrinsic::trans_intrinsic_call;
let (dest, llargs) = if fn_ty.ret.is_indirect() {
(SaveIn(llargs[0]), &llargs[1..])

View File

@ -13,14 +13,14 @@ use rustc::ty::{Ty, TypeFoldable};
use rustc::middle::const_eval::{self, ConstVal};
use rustc_const_eval::ConstInt::*;
use rustc::mir::repr as mir;
use trans::abi;
use trans::common::{self, BlockAndBuilder, C_bool, C_bytes, C_floating_f64, C_integral,
use abi;
use common::{self, BlockAndBuilder, C_bool, C_bytes, C_floating_f64, C_integral,
C_str_slice, C_undef};
use trans::consts;
use trans::datum;
use trans::expr;
use trans::type_of;
use trans::type_::Type;
use consts;
use datum;
use expr;
use type_of;
use type_::Type;
use super::operand::{OperandRef, OperandValue};
use super::MirContext;

View File

@ -10,12 +10,12 @@
use llvm::ValueRef;
use rustc::ty::Ty;
use trans::adt;
use trans::base;
use trans::common::{self, BlockAndBuilder};
use trans::machine;
use trans::type_of;
use trans::type_::Type;
use adt;
use base;
use common::{self, BlockAndBuilder};
use machine;
use type_of;
use type_::Type;
pub fn drop_fill<'bcx, 'tcx>(bcx: &BlockAndBuilder<'bcx, 'tcx>, value: ValueRef, ty: Ty<'tcx>) {
let llty = type_of::type_of(bcx.ccx(), ty);

View File

@ -12,16 +12,16 @@ use llvm::ValueRef;
use rustc::ty::{self, Ty, TypeFoldable};
use rustc::mir::repr as mir;
use rustc::mir::tcx::LvalueTy;
use trans::abi;
use trans::adt;
use trans::base;
use trans::builder::Builder;
use trans::common::{self, BlockAndBuilder, C_uint};
use trans::consts;
use trans::machine;
use trans::mir::drop;
use abi;
use adt;
use base;
use builder::Builder;
use common::{self, BlockAndBuilder, C_uint};
use consts;
use machine;
use mir::drop;
use llvm;
use trans::Disr;
use Disr;
use std::ptr;

View File

@ -13,8 +13,8 @@ use llvm::{self, ValueRef};
use rustc::ty;
use rustc::mir::repr as mir;
use rustc::mir::tcx::LvalueTy;
use trans::base;
use trans::common::{self, Block, BlockAndBuilder, FunctionContext};
use base;
use common::{self, Block, BlockAndBuilder, FunctionContext};
use std::ops::Deref;
use std::rc::Rc;

View File

@ -11,11 +11,11 @@
use llvm::ValueRef;
use rustc::ty::Ty;
use rustc::mir::repr as mir;
use trans::base;
use trans::common::{self, Block, BlockAndBuilder};
use trans::datum;
use trans::value::Value;
use trans::glue;
use base;
use common::{self, Block, BlockAndBuilder};
use datum;
use value::Value;
use glue;
use std::fmt;

View File

@ -15,20 +15,20 @@ use middle::const_eval::ConstVal;
use rustc_const_eval::ConstInt;
use rustc::mir::repr as mir;
use trans::asm;
use trans::base;
use trans::callee::Callee;
use trans::common::{self, C_uint, BlockAndBuilder, Result};
use trans::datum::{Datum, Lvalue};
use trans::debuginfo::DebugLoc;
use trans::declare;
use trans::adt;
use trans::machine;
use trans::type_::Type;
use trans::type_of;
use trans::tvec;
use trans::value::Value;
use trans::Disr;
use asm;
use base;
use callee::Callee;
use common::{self, C_uint, BlockAndBuilder, Result};
use datum::{Datum, Lvalue};
use debuginfo::DebugLoc;
use declare;
use adt;
use machine;
use type_::Type;
use type_of;
use tvec;
use value::Value;
use Disr;
use super::MirContext;
use super::operand::{OperandRef, OperandValue};
@ -138,7 +138,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
use syntax::ast::DUMMY_NODE_ID;
use syntax::codemap::DUMMY_SP;
use syntax::ptr::P;
use trans::closure;
use closure;
closure::trans_closure_expr(closure::Dest::Ignore(bcx.ccx()),
&hir::FnDecl {

View File

@ -9,7 +9,7 @@
// except according to those terms.
use rustc::mir::repr as mir;
use trans::common::BlockAndBuilder;
use common::BlockAndBuilder;
use super::MirContext;
use super::TempRef;

View File

@ -16,13 +16,13 @@ use rustc::infer::normalize_associated_type;
use rustc::ty::subst;
use rustc::ty::subst::{Subst, Substs};
use rustc::ty::{self, Ty, TypeFoldable, TyCtxt};
use trans::attributes;
use trans::base::{push_ctxt};
use trans::base::trans_fn;
use trans::base;
use trans::common::*;
use trans::declare;
use trans::Disr;
use attributes;
use base::{push_ctxt};
use base::trans_fn;
use base;
use common::*;
use declare;
use Disr;
use rustc::front::map as hir_map;
use rustc::util::ppaux;

View File

@ -15,13 +15,13 @@
//! paths etc in all kinds of annoying scenarios.
use back::symbol_names;
use rustc::ty::TyCtxt;
use rustc_front::hir;
use rustc_front::intravisit::{self, Visitor};
use syntax::ast;
use syntax::attr::AttrMetaMethods;
use trans::common::CrateContext;
use trans::monomorphize::Instance;
use common::CrateContext;
use monomorphize::Instance;
const SYMBOL_NAME: &'static str = "rustc_symbol_name";
const ITEM_PATH: &'static str = "rustc_item_path";
@ -36,28 +36,28 @@ pub fn report_symbol_names(ccx: &CrateContext) {
}
let _ignore = tcx.dep_graph.in_ignore();
let mut visitor = SymbolNamesTest { ccx: ccx, tcx: tcx };
let mut visitor = SymbolNamesTest { ccx: ccx };
tcx.map.krate().visit_all_items(&mut visitor);
}
struct SymbolNamesTest<'a, 'tcx:'a> {
ccx: &'a CrateContext<'a, 'tcx>,
tcx: &'a TyCtxt<'tcx>,
}
impl<'a, 'tcx> SymbolNamesTest<'a, 'tcx> {
fn process_attrs(&mut self,
node_id: ast::NodeId) {
let def_id = self.tcx.map.local_def_id(node_id);
for attr in self.tcx.get_attrs(def_id).iter() {
let tcx = self.ccx.tcx();
let def_id = tcx.map.local_def_id(node_id);
for attr in tcx.get_attrs(def_id).iter() {
if attr.check_name(SYMBOL_NAME) {
// for now, can only use on monomorphic names
let instance = Instance::mono(self.tcx, def_id);
let instance = Instance::mono(tcx, def_id);
let name = symbol_names::exported_name(self.ccx, &instance);
self.tcx.sess.span_err(attr.span, &format!("symbol-name({})", name));
tcx.sess.span_err(attr.span, &format!("symbol-name({})", name));
} else if attr.check_name(ITEM_PATH) {
let path = self.tcx.item_path_str(def_id);
self.tcx.sess.span_err(attr.span, &format!("item-path({})", path));
let path = tcx.item_path_str(def_id);
tcx.sess.span_err(attr.span, &format!("item-path({})", path));
}
// (*) The formatting of `tag({})` is chosen so that tests can elect

View File

@ -1,84 +0,0 @@
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use llvm::{ContextRef, ModuleRef};
use middle::cstore::LinkMeta;
pub use self::base::trans_crate;
pub use self::context::CrateContext;
pub use self::common::gensym_name;
pub use self::disr::Disr;
pub use self::monomorphize::Instance;
#[macro_use]
mod macros;
mod abi;
mod adt;
mod asm;
mod assert_dep_graph;
mod attributes;
mod base;
mod basic_block;
mod build;
mod builder;
mod cabi_aarch64;
mod cabi_arm;
mod cabi_asmjs;
mod cabi_mips;
mod cabi_powerpc;
mod cabi_powerpc64;
mod cabi_x86;
mod cabi_x86_64;
mod cabi_x86_win64;
mod callee;
mod cleanup;
mod closure;
mod common;
mod consts;
mod context;
mod controlflow;
mod datum;
mod debuginfo;
mod declare;
mod disr;
mod expr;
mod glue;
mod inline;
mod intrinsic;
mod machine;
mod _match;
mod meth;
mod mir;
mod monomorphize;
mod collector;
mod symbol_names_test;
mod tvec;
mod type_;
mod type_of;
mod value;
#[derive(Copy, Clone)]
pub struct ModuleTranslation {
pub llcx: ContextRef,
pub llmod: ModuleRef,
}
unsafe impl Send for ModuleTranslation { }
unsafe impl Sync for ModuleTranslation { }
pub struct CrateTranslation {
pub modules: Vec<ModuleTranslation>,
pub metadata_module: ModuleTranslation,
pub link: LinkMeta,
pub metadata: Vec<u8>,
pub reachable: Vec<String>,
pub no_builtins: bool,
}

View File

@ -12,21 +12,21 @@
use llvm;
use llvm::ValueRef;
use trans::base::*;
use trans::base;
use trans::build::*;
use trans::cleanup;
use trans::cleanup::CleanupMethods;
use trans::common::*;
use trans::consts;
use trans::datum::*;
use trans::debuginfo::DebugLoc;
use trans::expr::{Dest, Ignore, SaveIn};
use trans::expr;
use trans::machine::llsize_of_alloc;
use trans::type_::Type;
use trans::type_of;
use trans::value::Value;
use base::*;
use base;
use build::*;
use cleanup;
use cleanup::CleanupMethods;
use common::*;
use consts;
use datum::*;
use debuginfo::DebugLoc;
use expr::{Dest, Ignore, SaveIn};
use expr;
use machine::llsize_of_alloc;
use type_::Type;
use type_of;
use value::Value;
use rustc::ty::{self, Ty};
use rustc_front::hir;

View File

@ -14,7 +14,7 @@ use llvm;
use llvm::{TypeRef, Bool, False, True, TypeKind};
use llvm::{Float, Double, X86_FP80, PPC_FP128, FP128};
use trans::context::CrateContext;
use context::CrateContext;
use util::nodemap::FnvHashMap;
use syntax::ast;

View File

@ -13,13 +13,13 @@
use middle::def_id::DefId;
use rustc::infer;
use rustc::ty::subst;
use trans::abi::FnType;
use trans::adt;
use trans::common::*;
use trans::machine;
use abi::FnType;
use adt;
use common::*;
use machine;
use rustc::ty::{self, Ty, TypeFoldable};
use trans::type_::Type;
use type_::Type;
use syntax::ast;

View File

@ -10,8 +10,8 @@
use llvm;
use llvm::{UseRef, ValueRef};
use trans::basic_block::BasicBlock;
use trans::common::Block;
use basic_block::BasicBlock;
use common::Block;
use std::fmt;