1
Fork 0

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_metadata::cstore::CStore;
use rustc_trans::back::link; use rustc_trans::back::link;
use rustc_trans::back::write; use rustc_trans::back::write;
use rustc_trans::trans; use rustc_trans as trans;
use rustc_typeck as typeck; use rustc_typeck as typeck;
use rustc_privacy; use rustc_privacy;
use rustc_plugin::registry::Registry; use rustc_plugin::registry::Registry;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -97,7 +97,8 @@
//! virtually impossible. Thus, symbol hash generation exclusively relies on //! virtually impossible. Thus, symbol hash generation exclusively relies on
//! DefPaths which are much more robust in the face of changes to the code base. //! 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 util::sha2::{Digest, Sha256};
use rustc::middle::cstore; use rustc::middle::cstore;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -11,8 +11,8 @@
#![allow(non_upper_case_globals)] #![allow(non_upper_case_globals)]
use llvm::{Struct, Array, Attribute}; use llvm::{Struct, Array, Attribute};
use trans::abi::{FnType, ArgType}; use abi::{FnType, ArgType};
use trans::context::CrateContext; use context::CrateContext;
// Data layout: e-p:32:32-i64:64-v128:32:128-n32-S128 // 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 std::cmp;
use llvm; use llvm;
use llvm::{Integer, Pointer, Float, Double, Struct, Array, Vector}; use llvm::{Integer, Pointer, Float, Double, Struct, Array, Vector};
use trans::abi::{ArgType, FnType}; use abi::{ArgType, FnType};
use trans::context::CrateContext; use context::CrateContext;
use trans::type_::Type; use type_::Type;
fn align_up_to(off: usize, a: usize) -> usize { fn align_up_to(off: usize, a: usize) -> usize {
return (off + a - 1) / a * a; return (off + a - 1) / a * a;

View file

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

View file

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

View file

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

View file

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

View file

@ -11,8 +11,8 @@
use llvm::*; use llvm::*;
use super::common::*; use super::common::*;
use super::machine::*; use super::machine::*;
use trans::abi::{ArgType, FnType}; use abi::{ArgType, FnType};
use trans::type_::Type; use type_::Type;
// Win64 ABI: http://msdn.microsoft.com/en-us/library/zthk2dkh.aspx // 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::ty::subst::{Substs};
use rustc::traits; use rustc::traits;
use rustc::front::map as hir_map; use rustc::front::map as hir_map;
use trans::abi::{Abi, FnType}; use abi::{Abi, FnType};
use trans::adt; use adt;
use trans::attributes; use attributes;
use trans::base; use base;
use trans::base::*; use base::*;
use trans::build::*; use build::*;
use trans::cleanup; use cleanup;
use trans::cleanup::CleanupMethods; use cleanup::CleanupMethods;
use trans::closure; use closure;
use trans::common::{self, Block, Result, CrateContext, FunctionContext}; use common::{self, Block, Result, CrateContext, FunctionContext};
use trans::common::{C_uint, C_undef}; use common::{C_uint, C_undef};
use trans::consts; use consts;
use trans::datum::*; use datum::*;
use trans::debuginfo::DebugLoc; use debuginfo::DebugLoc;
use trans::declare; use declare;
use trans::expr; use expr;
use trans::glue; use glue;
use trans::inline; use inline;
use trans::intrinsic; use intrinsic;
use trans::machine::{llalign_of_min, llsize_of_store}; use machine::{llalign_of_min, llsize_of_store};
use trans::meth; use meth;
use trans::monomorphize::{self, Instance}; use monomorphize::{self, Instance};
use trans::type_::Type; use type_::Type;
use trans::type_of; use type_of;
use trans::value::Value; use value::Value;
use trans::Disr; use Disr;
use rustc::ty::{self, Ty, TyCtxt, TypeFoldable}; use rustc::ty::{self, Ty, TyCtxt, TypeFoldable};
use rustc_front::hir; use rustc_front::hir;

View file

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

View file

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

View file

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

View file

@ -22,21 +22,21 @@ use middle::def_id::DefId;
use rustc::infer; use rustc::infer;
use middle::lang_items::LangItem; use middle::lang_items::LangItem;
use rustc::ty::subst::Substs; use rustc::ty::subst::Substs;
use trans::abi::{Abi, FnType}; use abi::{Abi, FnType};
use trans::base; use base;
use trans::build; use build;
use trans::builder::Builder; use builder::Builder;
use trans::callee::Callee; use callee::Callee;
use trans::cleanup; use cleanup;
use trans::consts; use consts;
use trans::datum; use datum;
use trans::debuginfo::{self, DebugLoc}; use debuginfo::{self, DebugLoc};
use trans::declare; use declare;
use trans::machine; use machine;
use trans::mir::CachedMir; use mir::CachedMir;
use trans::monomorphize; use monomorphize;
use trans::type_::Type; use type_::Type;
use trans::value::Value; use value::Value;
use rustc::ty::{self, Ty, TyCtxt}; use rustc::ty::{self, Ty, TyCtxt};
use rustc::traits::{self, SelectionContext, ProjectionMode}; use rustc::traits::{self, SelectionContext, ProjectionMode};
use rustc::ty::fold::{TypeFolder, TypeFoldable}; 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::InternedString;
use syntax::parse::token; use syntax::parse::token;
pub use trans::context::CrateContext; pub use context::CrateContext;
/// Is the type's representation size known at compile time? /// Is the type's representation size known at compile time?
pub fn type_is_sized<'tcx>(tcx: &TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool { 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 { pub fn type_is_immediate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -> bool {
use trans::machine::llsize_of_alloc; use machine::llsize_of_alloc;
use trans::type_of::sizing_type_of; use type_of::sizing_type_of;
let tcx = ccx.tcx(); let tcx = ccx.tcx();
let simple = ty.is_scalar() || 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. /// Identify types which have size zero at runtime.
pub fn type_is_zero_size<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -> bool { pub fn type_is_zero_size<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -> bool {
use trans::machine::llsize_of_alloc; use machine::llsize_of_alloc;
use trans::type_of::sizing_type_of; use type_of::sizing_type_of;
let llty = sizing_type_of(ccx, ty); let llty = sizing_type_of(ccx, ty);
llsize_of_alloc(ccx, llty) == 0 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)] #[derive(Copy, Clone)]
pub struct NodeIdAndSpan { 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, // Returns a ValueRef of the "eh_unwind_resume" lang item if one is defined,
// otherwise declares it as an external function. // otherwise declares it as an external function.
pub fn eh_unwind_resume(&self) -> Callee<'tcx> { pub fn eh_unwind_resume(&self) -> Callee<'tcx> {
use trans::attributes; use attributes;
let ccx = self.ccx; let ccx = self.ccx;
let tcx = ccx.tcx(); let tcx = ccx.tcx();
assert!(ccx.sess().target.target.options.custom_unwind_resume); 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::Def;
use middle::def_id::DefId; use middle::def_id::DefId;
use rustc::front::map as hir_map; use rustc::front::map as hir_map;
use trans::{abi, adt, closure, debuginfo, expr, machine}; use {abi, adt, closure, debuginfo, expr, machine};
use trans::base::{self, exported_name, imported_name, push_ctxt}; use base::{self, exported_name, imported_name, push_ctxt};
use trans::callee::Callee; use callee::Callee;
use trans::collector::{self, TransItem}; use collector::{self, TransItem};
use trans::common::{type_is_sized, C_nil, const_get_elt}; use 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 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 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 common::{type_is_fat_ptr, Field, C_vector, C_array, C_null};
use trans::datum::{Datum, Lvalue}; use datum::{Datum, Lvalue};
use trans::declare; use declare;
use trans::monomorphize::{self, Instance}; use monomorphize::{self, Instance};
use trans::type_::Type; use type_::Type;
use trans::type_of; use type_of;
use trans::value::Value; use value::Value;
use trans::Disr; use Disr;
use rustc::ty::subst::Substs; use rustc::ty::subst::Substs;
use rustc::ty::adjustment::{AdjustDerefRef, AdjustReifyFnPointer}; use rustc::ty::adjustment::{AdjustDerefRef, AdjustReifyFnPointer};
use rustc::ty::adjustment::{AdjustUnsafeFnPointer, AdjustMutToConstPointer}; use rustc::ty::adjustment::{AdjustUnsafeFnPointer, AdjustMutToConstPointer};

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -32,10 +32,9 @@ use rustc::ty::subst::{self, Substs};
use rustc_front; use rustc_front;
use rustc_front::hir; use rustc_front::hir;
use trans::abi::Abi; use abi::Abi;
use trans::common::{NodeIdAndSpan, CrateContext, FunctionContext, Block}; use common::{NodeIdAndSpan, CrateContext, FunctionContext, Block};
use trans; use monomorphize;
use trans::monomorphize;
use rustc::infer; use rustc::infer;
use rustc::ty::{self, Ty}; use rustc::ty::{self, Ty};
use session::config::{self, FullDebugInfo, LimitedDebugInfo, NoDebugInfo}; use session::config::{self, FullDebugInfo, LimitedDebugInfo, NoDebugInfo};
@ -632,7 +631,7 @@ fn declare_local<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
debug_loc, debug_loc,
bcx.llbb); 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 llvm::debuginfo::DIScope;
use rustc::middle::def_id::DefId; use rustc::middle::def_id::DefId;
use rustc::front::map as hir_map; use rustc::front::map as hir_map;
use trans::common::CrateContext; use common::CrateContext;
use std::ffi::CString; use std::ffi::CString;
use std::ptr; use std::ptr;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -61,6 +61,9 @@ pub use rustc::middle;
pub use rustc::lint; pub use rustc::lint;
pub use rustc::util; pub use rustc::util;
pub use base::trans_crate;
pub use disr::Disr;
pub mod back { pub mod back {
pub use rustc_back::rpath; pub use rustc_back::rpath;
pub use rustc_back::svh; pub use rustc_back::svh;
@ -76,10 +79,70 @@ pub mod back {
pub mod diagnostics; pub mod diagnostics;
pub mod trans; #[macro_use]
mod macros;
pub mod lib { mod abi;
pub use llvm; 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 } __build_diagnostic_array! { librustc_trans, DIAGNOSTICS }

View file

@ -13,9 +13,9 @@
#![allow(non_camel_case_types)] #![allow(non_camel_case_types)]
use llvm::{self, ValueRef}; use llvm::{self, ValueRef};
use trans::common::*; use common::*;
use trans::type_::Type; use type_::Type;
pub type llbits = u64; pub type llbits = u64;
pub type llsize = 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::{FnSpace, Subst, Substs};
use rustc::ty::subst; use rustc::ty::subst;
use rustc::traits::{self, ProjectionMode}; use rustc::traits::{self, ProjectionMode};
use trans::abi::FnType; use abi::FnType;
use trans::base::*; use base::*;
use trans::build::*; use build::*;
use trans::callee::{Callee, Virtual, ArgVals, trans_fn_pointer_shim}; use callee::{Callee, Virtual, ArgVals, trans_fn_pointer_shim};
use trans::closure; use closure;
use trans::common::*; use common::*;
use trans::consts; use consts;
use trans::debuginfo::DebugLoc; use debuginfo::DebugLoc;
use trans::declare; use declare;
use trans::expr; use expr;
use trans::glue; use glue;
use trans::machine; use machine;
use trans::type_::Type; use type_::Type;
use trans::type_of::*; use type_of::*;
use trans::value::Value; use value::Value;
use rustc::ty::{self, Ty, TyCtxt, TypeFoldable}; use rustc::ty::{self, Ty, TyCtxt, TypeFoldable};
use syntax::ast::Name; use syntax::ast::Name;

View file

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

View file

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

View file

@ -10,12 +10,12 @@
use llvm::ValueRef; use llvm::ValueRef;
use rustc::ty::Ty; use rustc::ty::Ty;
use trans::adt; use adt;
use trans::base; use base;
use trans::common::{self, BlockAndBuilder}; use common::{self, BlockAndBuilder};
use trans::machine; use machine;
use trans::type_of; use type_of;
use trans::type_::Type; use type_::Type;
pub fn drop_fill<'bcx, 'tcx>(bcx: &BlockAndBuilder<'bcx, 'tcx>, value: ValueRef, ty: Ty<'tcx>) { pub fn drop_fill<'bcx, 'tcx>(bcx: &BlockAndBuilder<'bcx, 'tcx>, value: ValueRef, ty: Ty<'tcx>) {
let llty = type_of::type_of(bcx.ccx(), ty); 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::ty::{self, Ty, TypeFoldable};
use rustc::mir::repr as mir; use rustc::mir::repr as mir;
use rustc::mir::tcx::LvalueTy; use rustc::mir::tcx::LvalueTy;
use trans::abi; use abi;
use trans::adt; use adt;
use trans::base; use base;
use trans::builder::Builder; use builder::Builder;
use trans::common::{self, BlockAndBuilder, C_uint}; use common::{self, BlockAndBuilder, C_uint};
use trans::consts; use consts;
use trans::machine; use machine;
use trans::mir::drop; use mir::drop;
use llvm; use llvm;
use trans::Disr; use Disr;
use std::ptr; use std::ptr;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -15,13 +15,13 @@
//! paths etc in all kinds of annoying scenarios. //! paths etc in all kinds of annoying scenarios.
use back::symbol_names; use back::symbol_names;
use rustc::ty::TyCtxt;
use rustc_front::hir; use rustc_front::hir;
use rustc_front::intravisit::{self, Visitor}; use rustc_front::intravisit::{self, Visitor};
use syntax::ast; use syntax::ast;
use syntax::attr::AttrMetaMethods; 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 SYMBOL_NAME: &'static str = "rustc_symbol_name";
const ITEM_PATH: &'static str = "rustc_item_path"; 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 _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); tcx.map.krate().visit_all_items(&mut visitor);
} }
struct SymbolNamesTest<'a, 'tcx:'a> { struct SymbolNamesTest<'a, 'tcx:'a> {
ccx: &'a CrateContext<'a, 'tcx>, ccx: &'a CrateContext<'a, 'tcx>,
tcx: &'a TyCtxt<'tcx>,
} }
impl<'a, 'tcx> SymbolNamesTest<'a, 'tcx> { impl<'a, 'tcx> SymbolNamesTest<'a, 'tcx> {
fn process_attrs(&mut self, fn process_attrs(&mut self,
node_id: ast::NodeId) { node_id: ast::NodeId) {
let def_id = self.tcx.map.local_def_id(node_id); let tcx = self.ccx.tcx();
for attr in self.tcx.get_attrs(def_id).iter() { 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) { if attr.check_name(SYMBOL_NAME) {
// for now, can only use on monomorphic names // 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); 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) { } else if attr.check_name(ITEM_PATH) {
let path = self.tcx.item_path_str(def_id); let path = tcx.item_path_str(def_id);
self.tcx.sess.span_err(attr.span, &format!("item-path({})", path)); tcx.sess.span_err(attr.span, &format!("item-path({})", path));
} }
// (*) The formatting of `tag({})` is chosen so that tests can elect // (*) 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;
use llvm::ValueRef; use llvm::ValueRef;
use trans::base::*; use base::*;
use trans::base; use base;
use trans::build::*; use build::*;
use trans::cleanup; use cleanup;
use trans::cleanup::CleanupMethods; use cleanup::CleanupMethods;
use trans::common::*; use common::*;
use trans::consts; use consts;
use trans::datum::*; use datum::*;
use trans::debuginfo::DebugLoc; use debuginfo::DebugLoc;
use trans::expr::{Dest, Ignore, SaveIn}; use expr::{Dest, Ignore, SaveIn};
use trans::expr; use expr;
use trans::machine::llsize_of_alloc; use machine::llsize_of_alloc;
use trans::type_::Type; use type_::Type;
use trans::type_of; use type_of;
use trans::value::Value; use value::Value;
use rustc::ty::{self, Ty}; use rustc::ty::{self, Ty};
use rustc_front::hir; use rustc_front::hir;

View file

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

View file

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

View file

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