Skip to content

Commit

Permalink
rustc_trans: move the contents of the trans module to top-level.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Mar 26, 2016
1 parent 9835928 commit 035a645
Show file tree
Hide file tree
Showing 68 changed files with 535 additions and 557 deletions.
2 changes: 1 addition & 1 deletion src/librustc_driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
36 changes: 18 additions & 18 deletions src/librustc_trans/trans/_match.rs → src/librustc_trans/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
32 changes: 16 additions & 16 deletions src/librustc_trans/trans/abi.rs → src/librustc_trans/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
30 changes: 15 additions & 15 deletions src/librustc_trans/trans/adt.rs → src/librustc_trans/adt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
12 changes: 6 additions & 6 deletions src/librustc_trans/trans/asm.rs → src/librustc_trans/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_trans/back/symbol_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
80 changes: 40 additions & 40 deletions src/librustc_trans/trans/base.rs → src/librustc_trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Loading

0 comments on commit 035a645

Please sign in to comment.