"memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc_codegen_ssa 0.0.0",
"rustc_llvm 0.0.0",
]
+[[package]]
+name = "rustc_codegen_ssa"
+version = "0.0.0"
+
[[package]]
name = "rustc_codegen_utils"
version = "0.0.0"
cc = "1.0.1"
num_cpus = "1.0"
rustc-demangle = "0.1.4"
+rustc_codegen_ssa = { path = "../librustc_codegen_ssa" }
rustc_llvm = { path = "../librustc_llvm" }
memmap = "0.6"
use rustc_codegen_utils::symbol_export;
use time_graph::Timeline;
use ModuleLlvm;
-use rustc_codegen_utils::{ModuleCodegen, ModuleKind};
+use rustc_codegen_ssa::{ModuleCodegen, ModuleKind};
use libc;
use llvm::{self, DiagnosticInfo, PassManager, SMDiagnostic};
use llvm_util;
use {CodegenResults, ModuleLlvm};
-use rustc_codegen_utils::{ModuleCodegen, ModuleKind, CachedModuleCodegen, CompiledModule};
+use rustc_codegen_ssa::{ModuleCodegen, ModuleKind, CachedModuleCodegen, CompiledModule};
use CrateInfo;
use rustc::hir::def_id::{CrateNum, LOCAL_CRATE};
use rustc::ty::TyCtxt;
//! int) and rec(x=int, y=int, z=int) will have the same llvm::Type.
use super::ModuleLlvm;
-use rustc_codegen_utils::{ModuleCodegen, ModuleKind, CachedModuleCodegen};
+use rustc_codegen_ssa::{ModuleCodegen, ModuleKind, CachedModuleCodegen};
use super::LlvmCodegenBackend;
use abi;
use callee;
use rustc_mir::monomorphize::item::DefPathBasedNames;
use common;
-use rustc_codegen_utils::common::{RealPredicate, TypeKind, IntPredicate};
+use rustc_codegen_ssa::common::{RealPredicate, TypeKind, IntPredicate};
use meth;
use mir;
use context::CodegenCx;
use llvm::{AtomicRmwBinOp, AtomicOrdering, SynchronizationScope, AsmDialect};
use llvm::{self, False, BasicBlock};
-use rustc_codegen_utils::common::{IntPredicate, TypeKind, RealPredicate};
-use rustc_codegen_utils;
+use rustc_codegen_ssa::common::{IntPredicate, TypeKind, RealPredicate};
+use rustc_codegen_ssa;
use common::Funclet;
use context::CodegenCx;
use type_::Type;
fn atomic_load(
&self,
ptr: &'ll Value,
- order: rustc_codegen_utils::common::AtomicOrdering,
+ order: rustc_codegen_ssa::common::AtomicOrdering,
size: Size,
) -> &'ll Value {
self.count_insn("load.atomic");
}
fn atomic_store(&self, val: &'ll Value, ptr: &'ll Value,
- order: rustc_codegen_utils::common::AtomicOrdering, size: Size) {
+ order: rustc_codegen_ssa::common::AtomicOrdering, size: Size) {
debug!("Store {:?} -> {:?}", val, ptr);
self.count_insn("store.atomic");
let ptr = self.check_store(val, ptr);
dst: &'ll Value,
cmp: &'ll Value,
src: &'ll Value,
- order: rustc_codegen_utils::common::AtomicOrdering,
- failure_order: rustc_codegen_utils::common::AtomicOrdering,
+ order: rustc_codegen_ssa::common::AtomicOrdering,
+ failure_order: rustc_codegen_ssa::common::AtomicOrdering,
weak: bool,
) -> &'ll Value {
let weak = if weak { llvm::True } else { llvm::False };
}
fn atomic_rmw(
&self,
- op: rustc_codegen_utils::common::AtomicRmwBinOp,
+ op: rustc_codegen_ssa::common::AtomicRmwBinOp,
dst: &'ll Value,
src: &'ll Value,
- order: rustc_codegen_utils::common::AtomicOrdering,
+ order: rustc_codegen_ssa::common::AtomicOrdering,
) -> &'ll Value {
unsafe {
llvm::LLVMBuildAtomicRMW(
fn atomic_fence(
&self,
- order: rustc_codegen_utils::common::AtomicOrdering,
- scope: rustc_codegen_utils::common::SynchronizationScope
+ order: rustc_codegen_ssa::common::AtomicOrdering,
+ scope: rustc_codegen_ssa::common::SynchronizationScope
) {
unsafe {
llvm::LLVMRustBuildAtomicFence(
use rustc::hir;
use mir::constant::const_alloc_to_llvm;
use mir::place::PlaceRef;
-use rustc_codegen_utils::common::TypeKind;
+use rustc_codegen_ssa::common::TypeKind;
use libc::{c_uint, c_char};
use std;
-use rustc_codegen_utils::common::IntPredicate;
+use rustc_codegen_ssa::common::IntPredicate;
use meth;
use rustc::ty::layout::LayoutOf;
use rustc::ty::{self, Ty};
use mir::operand::OperandRef;
use mir::place::PlaceRef;
use rustc::ty::layout::{Align, Size};
-use rustc_codegen_utils::common::{
+use rustc_codegen_ssa::common::{
AtomicOrdering, AtomicRmwBinOp, IntPredicate, RealPredicate, SynchronizationScope,
};
pub use self::type_::{
ArgTypeMethods, BaseTypeMethods, DerivedTypeMethods, LayoutTypeMethods, TypeMethods,
};
-pub use rustc_codegen_utils::interfaces::{Backend, BackendMethods, BackendTypes, CodegenObject};
+pub use rustc_codegen_ssa::interfaces::{Backend, BackendMethods, BackendTypes, CodegenObject};
pub trait CodegenMethods<'tcx>:
Backend<'tcx>
use rustc::ty::layout::{self, Align, Size};
use rustc::ty::Ty;
use rustc::util::nodemap::FxHashMap;
-use rustc_codegen_utils::common::TypeKind;
+use rustc_codegen_ssa::common::TypeKind;
use rustc_target::abi::call::{ArgType, CastTarget, FnType, Reg};
use std::cell::RefCell;
use syntax::ast;
use type_of::LayoutLlvmExt;
use rustc::ty::{self, Ty};
use rustc::ty::layout::{LayoutOf, HasTyCtxt};
-use rustc_codegen_utils::common::TypeKind;
+use rustc_codegen_ssa::common::TypeKind;
use rustc::hir;
use syntax::ast;
use syntax::symbol::Symbol;
// This requires that atomic intrinsics follow a specific naming pattern:
// "atomic_<operation>[_<ordering>]", and no ordering means SeqCst
name if name.starts_with("atomic_") => {
- use rustc_codegen_utils::common::AtomicOrdering::*;
- use rustc_codegen_utils::common::
+ use rustc_codegen_ssa::common::AtomicOrdering::*;
+ use rustc_codegen_ssa::common::
{SynchronizationScope, AtomicRmwBinOp};
let split: Vec<&str> = name.split('_').collect();
extern crate rustc_llvm;
extern crate rustc_platform_intrinsics as intrinsics;
extern crate rustc_codegen_utils;
+extern crate rustc_codegen_ssa;
extern crate rustc_fs_util;
#[macro_use] extern crate log;
use rustc::util::nodemap::{FxHashSet, FxHashMap};
use rustc::util::profiling::ProfileCategory;
use rustc_mir::monomorphize;
-use rustc_codegen_utils::{ModuleCodegen, CompiledModule};
+use rustc_codegen_ssa::{ModuleCodegen, CompiledModule};
use rustc_codegen_utils::codegen_backend::CodegenBackend;
use rustc_data_structures::svh::Svh;
use libc::{c_ulonglong, c_void};
use std::marker::PhantomData;
-use rustc_codegen_utils;
use syntax;
+use rustc_codegen_ssa;
use super::RustString;
}
impl IntPredicate {
- pub fn from_generic(intpre: rustc_codegen_utils::common::IntPredicate) -> Self {
+ pub fn from_generic(intpre: rustc_codegen_ssa::common::IntPredicate) -> Self {
match intpre {
- rustc_codegen_utils::common::IntPredicate::IntEQ => IntPredicate::IntEQ,
- rustc_codegen_utils::common::IntPredicate::IntNE => IntPredicate::IntNE,
- rustc_codegen_utils::common::IntPredicate::IntUGT => IntPredicate::IntUGT,
- rustc_codegen_utils::common::IntPredicate::IntUGE => IntPredicate::IntUGE,
- rustc_codegen_utils::common::IntPredicate::IntULT => IntPredicate::IntULT,
- rustc_codegen_utils::common::IntPredicate::IntULE => IntPredicate::IntULE,
- rustc_codegen_utils::common::IntPredicate::IntSGT => IntPredicate::IntSGT,
- rustc_codegen_utils::common::IntPredicate::IntSGE => IntPredicate::IntSGE,
- rustc_codegen_utils::common::IntPredicate::IntSLT => IntPredicate::IntSLT,
- rustc_codegen_utils::common::IntPredicate::IntSLE => IntPredicate::IntSLE,
+ rustc_codegen_ssa::common::IntPredicate::IntEQ => IntPredicate::IntEQ,
+ rustc_codegen_ssa::common::IntPredicate::IntNE => IntPredicate::IntNE,
+ rustc_codegen_ssa::common::IntPredicate::IntUGT => IntPredicate::IntUGT,
+ rustc_codegen_ssa::common::IntPredicate::IntUGE => IntPredicate::IntUGE,
+ rustc_codegen_ssa::common::IntPredicate::IntULT => IntPredicate::IntULT,
+ rustc_codegen_ssa::common::IntPredicate::IntULE => IntPredicate::IntULE,
+ rustc_codegen_ssa::common::IntPredicate::IntSGT => IntPredicate::IntSGT,
+ rustc_codegen_ssa::common::IntPredicate::IntSGE => IntPredicate::IntSGE,
+ rustc_codegen_ssa::common::IntPredicate::IntSLT => IntPredicate::IntSLT,
+ rustc_codegen_ssa::common::IntPredicate::IntSLE => IntPredicate::IntSLE,
}
}
}
}
impl RealPredicate {
- pub fn from_generic(realpred: rustc_codegen_utils::common::RealPredicate) -> Self {
+ pub fn from_generic(realpred: rustc_codegen_ssa::common::RealPredicate) -> Self {
match realpred {
- rustc_codegen_utils::common::RealPredicate::RealPredicateFalse =>
+ rustc_codegen_ssa::common::RealPredicate::RealPredicateFalse =>
RealPredicate::RealPredicateFalse,
- rustc_codegen_utils::common::RealPredicate::RealOEQ => RealPredicate::RealOEQ,
- rustc_codegen_utils::common::RealPredicate::RealOGT => RealPredicate::RealOGT,
- rustc_codegen_utils::common::RealPredicate::RealOGE => RealPredicate::RealOGE,
- rustc_codegen_utils::common::RealPredicate::RealOLT => RealPredicate::RealOLT,
- rustc_codegen_utils::common::RealPredicate::RealOLE => RealPredicate::RealOLE,
- rustc_codegen_utils::common::RealPredicate::RealONE => RealPredicate::RealONE,
- rustc_codegen_utils::common::RealPredicate::RealORD => RealPredicate::RealORD,
- rustc_codegen_utils::common::RealPredicate::RealUNO => RealPredicate::RealUNO,
- rustc_codegen_utils::common::RealPredicate::RealUEQ => RealPredicate::RealUEQ,
- rustc_codegen_utils::common::RealPredicate::RealUGT => RealPredicate::RealUGT,
- rustc_codegen_utils::common::RealPredicate::RealUGE => RealPredicate::RealUGE,
- rustc_codegen_utils::common::RealPredicate::RealULT => RealPredicate::RealULT,
- rustc_codegen_utils::common::RealPredicate::RealULE => RealPredicate::RealULE,
- rustc_codegen_utils::common::RealPredicate::RealUNE => RealPredicate::RealUNE,
- rustc_codegen_utils::common::RealPredicate::RealPredicateTrue =>
+ rustc_codegen_ssa::common::RealPredicate::RealOEQ => RealPredicate::RealOEQ,
+ rustc_codegen_ssa::common::RealPredicate::RealOGT => RealPredicate::RealOGT,
+ rustc_codegen_ssa::common::RealPredicate::RealOGE => RealPredicate::RealOGE,
+ rustc_codegen_ssa::common::RealPredicate::RealOLT => RealPredicate::RealOLT,
+ rustc_codegen_ssa::common::RealPredicate::RealOLE => RealPredicate::RealOLE,
+ rustc_codegen_ssa::common::RealPredicate::RealONE => RealPredicate::RealONE,
+ rustc_codegen_ssa::common::RealPredicate::RealORD => RealPredicate::RealORD,
+ rustc_codegen_ssa::common::RealPredicate::RealUNO => RealPredicate::RealUNO,
+ rustc_codegen_ssa::common::RealPredicate::RealUEQ => RealPredicate::RealUEQ,
+ rustc_codegen_ssa::common::RealPredicate::RealUGT => RealPredicate::RealUGT,
+ rustc_codegen_ssa::common::RealPredicate::RealUGE => RealPredicate::RealUGE,
+ rustc_codegen_ssa::common::RealPredicate::RealULT => RealPredicate::RealULT,
+ rustc_codegen_ssa::common::RealPredicate::RealULE => RealPredicate::RealULE,
+ rustc_codegen_ssa::common::RealPredicate::RealUNE => RealPredicate::RealUNE,
+ rustc_codegen_ssa::common::RealPredicate::RealPredicateTrue =>
RealPredicate::RealPredicateTrue
}
}
}
impl TypeKind {
- pub fn to_generic(self) -> rustc_codegen_utils::common::TypeKind {
+ pub fn to_generic(self) -> rustc_codegen_ssa::common::TypeKind {
match self {
- TypeKind::Void => rustc_codegen_utils::common::TypeKind::Void,
- TypeKind::Half => rustc_codegen_utils::common::TypeKind::Half,
- TypeKind::Float => rustc_codegen_utils::common::TypeKind::Float,
- TypeKind::Double => rustc_codegen_utils::common::TypeKind::Double,
- TypeKind::X86_FP80 => rustc_codegen_utils::common::TypeKind::X86_FP80,
- TypeKind::FP128 => rustc_codegen_utils::common::TypeKind::FP128,
- TypeKind::PPC_FP128 => rustc_codegen_utils::common::TypeKind::PPC_FP128,
- TypeKind::Label => rustc_codegen_utils::common::TypeKind::Label,
- TypeKind::Integer => rustc_codegen_utils::common::TypeKind::Integer,
- TypeKind::Function => rustc_codegen_utils::common::TypeKind::Function,
- TypeKind::Struct => rustc_codegen_utils::common::TypeKind::Struct,
- TypeKind::Array => rustc_codegen_utils::common::TypeKind::Array,
- TypeKind::Pointer => rustc_codegen_utils::common::TypeKind::Pointer,
- TypeKind::Vector => rustc_codegen_utils::common::TypeKind::Vector,
- TypeKind::Metadata => rustc_codegen_utils::common::TypeKind::Metadata,
- TypeKind::X86_MMX => rustc_codegen_utils::common::TypeKind::X86_MMX,
- TypeKind::Token => rustc_codegen_utils::common::TypeKind::Token,
+ TypeKind::Void => rustc_codegen_ssa::common::TypeKind::Void,
+ TypeKind::Half => rustc_codegen_ssa::common::TypeKind::Half,
+ TypeKind::Float => rustc_codegen_ssa::common::TypeKind::Float,
+ TypeKind::Double => rustc_codegen_ssa::common::TypeKind::Double,
+ TypeKind::X86_FP80 => rustc_codegen_ssa::common::TypeKind::X86_FP80,
+ TypeKind::FP128 => rustc_codegen_ssa::common::TypeKind::FP128,
+ TypeKind::PPC_FP128 => rustc_codegen_ssa::common::TypeKind::PPC_FP128,
+ TypeKind::Label => rustc_codegen_ssa::common::TypeKind::Label,
+ TypeKind::Integer => rustc_codegen_ssa::common::TypeKind::Integer,
+ TypeKind::Function => rustc_codegen_ssa::common::TypeKind::Function,
+ TypeKind::Struct => rustc_codegen_ssa::common::TypeKind::Struct,
+ TypeKind::Array => rustc_codegen_ssa::common::TypeKind::Array,
+ TypeKind::Pointer => rustc_codegen_ssa::common::TypeKind::Pointer,
+ TypeKind::Vector => rustc_codegen_ssa::common::TypeKind::Vector,
+ TypeKind::Metadata => rustc_codegen_ssa::common::TypeKind::Metadata,
+ TypeKind::X86_MMX => rustc_codegen_ssa::common::TypeKind::X86_MMX,
+ TypeKind::Token => rustc_codegen_ssa::common::TypeKind::Token,
}
}
}
}
impl AtomicRmwBinOp {
- pub fn from_generic(op: rustc_codegen_utils::common::AtomicRmwBinOp) -> Self {
+ pub fn from_generic(op: rustc_codegen_ssa::common::AtomicRmwBinOp) -> Self {
match op {
- rustc_codegen_utils::common::AtomicRmwBinOp::AtomicXchg => AtomicRmwBinOp::AtomicXchg,
- rustc_codegen_utils::common::AtomicRmwBinOp::AtomicAdd => AtomicRmwBinOp::AtomicAdd,
- rustc_codegen_utils::common::AtomicRmwBinOp::AtomicSub => AtomicRmwBinOp::AtomicSub,
- rustc_codegen_utils::common::AtomicRmwBinOp::AtomicAnd => AtomicRmwBinOp::AtomicAnd,
- rustc_codegen_utils::common::AtomicRmwBinOp::AtomicNand => AtomicRmwBinOp::AtomicNand,
- rustc_codegen_utils::common::AtomicRmwBinOp::AtomicOr => AtomicRmwBinOp::AtomicOr,
- rustc_codegen_utils::common::AtomicRmwBinOp::AtomicXor => AtomicRmwBinOp::AtomicXor,
- rustc_codegen_utils::common::AtomicRmwBinOp::AtomicMax => AtomicRmwBinOp::AtomicMax,
- rustc_codegen_utils::common::AtomicRmwBinOp::AtomicMin => AtomicRmwBinOp::AtomicMin,
- rustc_codegen_utils::common::AtomicRmwBinOp::AtomicUMax => AtomicRmwBinOp::AtomicUMax,
- rustc_codegen_utils::common::AtomicRmwBinOp::AtomicUMin => AtomicRmwBinOp::AtomicUMin
+ rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicXchg => AtomicRmwBinOp::AtomicXchg,
+ rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicAdd => AtomicRmwBinOp::AtomicAdd,
+ rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicSub => AtomicRmwBinOp::AtomicSub,
+ rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicAnd => AtomicRmwBinOp::AtomicAnd,
+ rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicNand => AtomicRmwBinOp::AtomicNand,
+ rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicOr => AtomicRmwBinOp::AtomicOr,
+ rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicXor => AtomicRmwBinOp::AtomicXor,
+ rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicMax => AtomicRmwBinOp::AtomicMax,
+ rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicMin => AtomicRmwBinOp::AtomicMin,
+ rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicUMax => AtomicRmwBinOp::AtomicUMax,
+ rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicUMin => AtomicRmwBinOp::AtomicUMin
}
}
}
}
impl AtomicOrdering {
- pub fn from_generic(ao: rustc_codegen_utils::common::AtomicOrdering) -> Self {
+ pub fn from_generic(ao: rustc_codegen_ssa::common::AtomicOrdering) -> Self {
match ao {
- rustc_codegen_utils::common::AtomicOrdering::NotAtomic => AtomicOrdering::NotAtomic,
- rustc_codegen_utils::common::AtomicOrdering::Unordered => AtomicOrdering::Unordered,
- rustc_codegen_utils::common::AtomicOrdering::Monotonic => AtomicOrdering::Monotonic,
- rustc_codegen_utils::common::AtomicOrdering::Acquire => AtomicOrdering::Acquire,
- rustc_codegen_utils::common::AtomicOrdering::Release => AtomicOrdering::Release,
- rustc_codegen_utils::common::AtomicOrdering::AcquireRelease =>
+ rustc_codegen_ssa::common::AtomicOrdering::NotAtomic => AtomicOrdering::NotAtomic,
+ rustc_codegen_ssa::common::AtomicOrdering::Unordered => AtomicOrdering::Unordered,
+ rustc_codegen_ssa::common::AtomicOrdering::Monotonic => AtomicOrdering::Monotonic,
+ rustc_codegen_ssa::common::AtomicOrdering::Acquire => AtomicOrdering::Acquire,
+ rustc_codegen_ssa::common::AtomicOrdering::Release => AtomicOrdering::Release,
+ rustc_codegen_ssa::common::AtomicOrdering::AcquireRelease =>
AtomicOrdering::AcquireRelease,
- rustc_codegen_utils::common::AtomicOrdering::SequentiallyConsistent =>
+ rustc_codegen_ssa::common::AtomicOrdering::SequentiallyConsistent =>
AtomicOrdering::SequentiallyConsistent
}
}
}
impl SynchronizationScope {
- pub fn from_generic(sc: rustc_codegen_utils::common::SynchronizationScope) -> Self {
+ pub fn from_generic(sc: rustc_codegen_ssa::common::SynchronizationScope) -> Self {
match sc {
- rustc_codegen_utils::common::SynchronizationScope::Other => SynchronizationScope::Other,
- rustc_codegen_utils::common::SynchronizationScope::SingleThread =>
+ rustc_codegen_ssa::common::SynchronizationScope::Other => SynchronizationScope::Other,
+ rustc_codegen_ssa::common::SynchronizationScope::SingleThread =>
SynchronizationScope::SingleThread,
- rustc_codegen_utils::common::SynchronizationScope::CrossThread =>
+ rustc_codegen_ssa::common::SynchronizationScope::CrossThread =>
SynchronizationScope::CrossThread,
}
}
use base;
use builder::MemFlags;
use common;
-use rustc_codegen_utils::common::IntPredicate;
+use rustc_codegen_ssa::common::IntPredicate;
use meth;
use monomorphize;
use rustc::mir;
use rustc::mir::tcx::PlaceTy;
use builder::MemFlags;
-use rustc_codegen_utils::common::IntPredicate;
+use rustc_codegen_ssa::common::IntPredicate;
use type_of::LayoutLlvmExt;
use glue;
use builder::MemFlags;
use callee;
use common;
-use rustc_codegen_utils::common::{RealPredicate, IntPredicate};
+use rustc_codegen_ssa::common::{RealPredicate, IntPredicate};
use monomorphize;
use type_of::LayoutLlvmExt;
use rustc_target::abi::call::{CastTarget, FnType, Reg};
use rustc_data_structures::small_c_str::SmallCStr;
use common;
-use rustc_codegen_utils;
-use rustc_codegen_utils::common::TypeKind;
+use rustc_codegen_ssa;
+use rustc_codegen_ssa::common::TypeKind;
use type_of::LayoutLlvmExt;
use abi::{LlvmType, FnTypeExt};
}
fn type_needs_drop(&self, ty: Ty<'tcx>) -> bool {
- rustc_codegen_utils::common::type_needs_drop(self.tcx(), ty)
+ rustc_codegen_ssa::common::type_needs_drop(self.tcx(), ty)
}
fn type_is_sized(&self, ty: Ty<'tcx>) -> bool {
- rustc_codegen_utils::common::type_is_sized(self.tcx(), ty)
+ rustc_codegen_ssa::common::type_is_sized(self.tcx(), ty)
}
fn type_is_freeze(&self, ty: Ty<'tcx>) -> bool {
- rustc_codegen_utils::common::type_is_freeze(self.tcx(), ty)
+ rustc_codegen_ssa::common::type_is_freeze(self.tcx(), ty)
}
fn type_has_metadata(&self, ty: Ty<'tcx>) -> bool {
--- /dev/null
+[package]
+authors = ["The Rust Project Developers"]
+name = "rustc_codegen_ssa"
+version = "0.0.0"
+
+[lib]
+name = "rustc_codegen_ssa"
+path = "lib.rs"
+test = false
+
+[dependencies]
--- /dev/null
+// Copyright 2018 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.
+#![allow(non_camel_case_types, non_snake_case)]
+
+use rustc::ty::{self, Ty, TyCtxt};
+use syntax_pos::DUMMY_SP;
+
+
+pub fn type_needs_drop<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, ty: Ty<'tcx>) -> bool {
+ ty.needs_drop(tcx, ty::ParamEnv::reveal_all())
+}
+
+pub fn type_is_sized<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, ty: Ty<'tcx>) -> bool {
+ ty.is_sized(tcx.at(DUMMY_SP), ty::ParamEnv::reveal_all())
+}
+
+pub fn type_is_freeze<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, ty: Ty<'tcx>) -> bool {
+ ty.is_freeze(tcx, ty::ParamEnv::reveal_all(), DUMMY_SP)
+}
+
+pub enum IntPredicate {
+ IntEQ,
+ IntNE,
+ IntUGT,
+ IntUGE,
+ IntULT,
+ IntULE,
+ IntSGT,
+ IntSGE,
+ IntSLT,
+ IntSLE
+}
+
+
+#[allow(dead_code)]
+pub enum RealPredicate {
+ RealPredicateFalse,
+ RealOEQ,
+ RealOGT,
+ RealOGE,
+ RealOLT,
+ RealOLE,
+ RealONE,
+ RealORD,
+ RealUNO,
+ RealUEQ,
+ RealUGT,
+ RealUGE,
+ RealULT,
+ RealULE,
+ RealUNE,
+ RealPredicateTrue
+}
+
+pub enum AtomicRmwBinOp {
+ AtomicXchg,
+ AtomicAdd,
+ AtomicSub,
+ AtomicAnd,
+ AtomicNand,
+ AtomicOr,
+ AtomicXor,
+ AtomicMax,
+ AtomicMin,
+ AtomicUMax,
+ AtomicUMin
+}
+
+pub enum AtomicOrdering {
+ #[allow(dead_code)]
+ NotAtomic,
+ Unordered,
+ Monotonic,
+ // Consume, // Not specified yet.
+ Acquire,
+ Release,
+ AcquireRelease,
+ SequentiallyConsistent,
+}
+
+pub enum SynchronizationScope {
+ // FIXME: figure out if this variant is needed at all.
+ #[allow(dead_code)]
+ Other,
+ SingleThread,
+ CrossThread,
+}
+
+#[derive(Copy, Clone, PartialEq, Debug)]
+pub enum TypeKind {
+ Void,
+ Half,
+ Float,
+ Double,
+ X86_FP80,
+ FP128,
+ PPC_FP128,
+ Label,
+ Integer,
+ Function,
+ Struct,
+ Array,
+ Pointer,
+ Vector,
+ Metadata,
+ X86_MMX,
+ Token,
+}
+
+// FIXME(mw): Anything that is produced via DepGraph::with_task() must implement
+// the HashStable trait. Normally DepGraph::with_task() calls are
+// hidden behind queries, but CGU creation is a special case in two
+// ways: (1) it's not a query and (2) CGU are output nodes, so their
+// Fingerprints are not actually needed. It remains to be clarified
+// how exactly this case will be handled in the red/green system but
+// for now we content ourselves with providing a no-op HashStable
+// implementation for CGUs.
+mod temp_stable_hash_impls {
+ use rustc_data_structures::stable_hasher::{StableHasherResult, StableHasher,
+ HashStable};
+ use ModuleCodegen;
+
+ impl<HCX, M> HashStable<HCX> for ModuleCodegen<M> {
+ fn hash_stable<W: StableHasherResult>(&self,
+ _: &mut HCX,
+ _: &mut StableHasher<W>) {
+ // do nothing
+ }
+ }
+}
--- /dev/null
+// Copyright 2018 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 rustc::ty::layout::{HasTyCtxt, LayoutOf, TyLayout};
+use rustc::ty::Ty;
+
+use super::CodegenObject;
+use rustc::middle::allocator::AllocatorKind;
+use rustc::middle::cstore::EncodedMetadata;
+use rustc::mir::mono::Stats;
+use rustc::session::Session;
+use rustc::ty::TyCtxt;
+use rustc::util::time_graph::TimeGraph;
+use std::any::Any;
+use std::sync::mpsc::Receiver;
+use syntax_pos::symbol::InternedString;
+use ModuleCodegen;
+
+pub trait BackendTypes {
+ type Value: CodegenObject;
+ type BasicBlock: Copy;
+ type Type: CodegenObject;
+ type Context;
+ type Funclet;
+
+ type DIScope: Copy;
+}
+
+pub trait Backend<'tcx>:
+ BackendTypes + HasTyCtxt<'tcx> + LayoutOf<Ty = Ty<'tcx>, TyLayout = TyLayout<'tcx>>
+{
+}
+
+impl<'tcx, T> Backend<'tcx> for T where
+ Self: BackendTypes + HasTyCtxt<'tcx> + LayoutOf<Ty = Ty<'tcx>, TyLayout = TyLayout<'tcx>>
+{}
+
+pub trait BackendMethods {
+ type Module;
+ type OngoingCodegen;
+
+ fn new_metadata(&self, sess: &Session, mod_name: &str) -> Self::Module;
+ fn write_metadata<'b, 'gcx>(
+ &self,
+ tcx: TyCtxt<'b, 'gcx, 'gcx>,
+ metadata: &Self::Module,
+ ) -> EncodedMetadata;
+ fn codegen_allocator(&self, tcx: TyCtxt, mods: &Self::Module, kind: AllocatorKind);
+
+ fn start_async_codegen(
+ &self,
+ tcx: TyCtxt,
+ time_graph: Option<TimeGraph>,
+ metadata: EncodedMetadata,
+ coordinator_receive: Receiver<Box<dyn Any + Send>>,
+ total_cgus: usize,
+ ) -> Self::OngoingCodegen;
+ fn submit_pre_codegened_module_to_llvm(
+ &self,
+ codegen: &Self::OngoingCodegen,
+ tcx: TyCtxt,
+ module: ModuleCodegen<Self::Module>,
+ );
+ fn codegen_aborted(codegen: Self::OngoingCodegen);
+ fn codegen_finished(&self, codegen: &Self::OngoingCodegen, tcx: TyCtxt);
+ fn check_for_errors(&self, codegen: &Self::OngoingCodegen, sess: &Session);
+ fn wait_for_signal_to_codegen_item(&self, codegen: &Self::OngoingCodegen);
+ fn compile_codegen_unit<'a, 'tcx: 'a>(
+ &self,
+ tcx: TyCtxt<'a, 'tcx, 'tcx>,
+ cgu_name: InternedString,
+ ) -> Stats;
+}
--- /dev/null
+// Copyright 2018 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.
+
+mod backend;
+
+pub use self::backend::{Backend, BackendMethods, BackendTypes};
+
+use std::fmt;
+
+pub trait CodegenObject: Copy + PartialEq + fmt::Debug {}
+impl<T: Copy + PartialEq + fmt::Debug> CodegenObject for T {}
--- /dev/null
+// Copyright 2017 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.
+
+//! # Note
+//!
+//! This API is completely unstable and subject to change.
+
+#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
+ html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
+ html_root_url = "https://doc.rust-lang.org/nightly/")]
+
+#![feature(box_patterns)]
+#![feature(box_syntax)]
+#![feature(custom_attribute)]
+#![feature(nll)]
+#![allow(unused_attributes)]
+#![allow(dead_code)]
+#![feature(quote)]
+#![feature(rustc_diagnostic_macros)]
+
+#![recursion_limit="256"]
+
+extern crate rustc;
+extern crate rustc_target;
+extern crate rustc_mir;
+extern crate syntax;
+extern crate syntax_pos;
+extern crate rustc_data_structures;
+
+use std::path::PathBuf;
+use rustc::dep_graph::WorkProduct;
+use rustc::session::config::{OutputFilenames, OutputType};
+
+pub mod common;
+pub mod interfaces;
+
+pub struct ModuleCodegen<M> {
+ /// The name of the module. When the crate may be saved between
+ /// compilations, incremental compilation requires that name be
+ /// unique amongst **all** crates. Therefore, it should contain
+ /// something unique to this crate (e.g., a module path) as well
+ /// as the crate name and disambiguator.
+ /// We currently generate these names via CodegenUnit::build_cgu_name().
+ pub name: String,
+ pub module_llvm: M,
+ pub kind: ModuleKind,
+}
+
+pub const RLIB_BYTECODE_EXTENSION: &str = "bc.z";
+
+impl<M> ModuleCodegen<M> {
+ pub fn into_compiled_module(self,
+ emit_obj: bool,
+ emit_bc: bool,
+ emit_bc_compressed: bool,
+ outputs: &OutputFilenames) -> CompiledModule {
+ let object = if emit_obj {
+ Some(outputs.temp_path(OutputType::Object, Some(&self.name)))
+ } else {
+ None
+ };
+ let bytecode = if emit_bc {
+ Some(outputs.temp_path(OutputType::Bitcode, Some(&self.name)))
+ } else {
+ None
+ };
+ let bytecode_compressed = if emit_bc_compressed {
+ Some(outputs.temp_path(OutputType::Bitcode, Some(&self.name))
+ .with_extension(RLIB_BYTECODE_EXTENSION))
+ } else {
+ None
+ };
+
+ CompiledModule {
+ name: self.name.clone(),
+ kind: self.kind,
+ object,
+ bytecode,
+ bytecode_compressed,
+ }
+ }
+}
+
+#[derive(Debug)]
+pub struct CompiledModule {
+ pub name: String,
+ pub kind: ModuleKind,
+ pub object: Option<PathBuf>,
+ pub bytecode: Option<PathBuf>,
+ pub bytecode_compressed: Option<PathBuf>,
+}
+
+pub struct CachedModuleCodegen {
+ pub name: String,
+ pub source: WorkProduct,
+}
+
+#[derive(Copy, Clone, Debug, PartialEq)]
+pub enum ModuleKind {
+ Regular,
+ Metadata,
+ Allocator,
+}
+
+
+__build_diagnostic_array! { librustc_codegen_ssa, DIAGNOSTICS }
+++ /dev/null
-// Copyright 2018 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.
-#![allow(non_camel_case_types, non_snake_case)]
-
-use rustc::ty::{self, Ty, TyCtxt};
-use syntax_pos::DUMMY_SP;
-
-
-pub fn type_needs_drop<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, ty: Ty<'tcx>) -> bool {
- ty.needs_drop(tcx, ty::ParamEnv::reveal_all())
-}
-
-pub fn type_is_sized<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, ty: Ty<'tcx>) -> bool {
- ty.is_sized(tcx.at(DUMMY_SP), ty::ParamEnv::reveal_all())
-}
-
-pub fn type_is_freeze<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, ty: Ty<'tcx>) -> bool {
- ty.is_freeze(tcx, ty::ParamEnv::reveal_all(), DUMMY_SP)
-}
-
-pub enum IntPredicate {
- IntEQ,
- IntNE,
- IntUGT,
- IntUGE,
- IntULT,
- IntULE,
- IntSGT,
- IntSGE,
- IntSLT,
- IntSLE
-}
-
-
-#[allow(dead_code)]
-pub enum RealPredicate {
- RealPredicateFalse,
- RealOEQ,
- RealOGT,
- RealOGE,
- RealOLT,
- RealOLE,
- RealONE,
- RealORD,
- RealUNO,
- RealUEQ,
- RealUGT,
- RealUGE,
- RealULT,
- RealULE,
- RealUNE,
- RealPredicateTrue
-}
-
-pub enum AtomicRmwBinOp {
- AtomicXchg,
- AtomicAdd,
- AtomicSub,
- AtomicAnd,
- AtomicNand,
- AtomicOr,
- AtomicXor,
- AtomicMax,
- AtomicMin,
- AtomicUMax,
- AtomicUMin
-}
-
-pub enum AtomicOrdering {
- #[allow(dead_code)]
- NotAtomic,
- Unordered,
- Monotonic,
- // Consume, // Not specified yet.
- Acquire,
- Release,
- AcquireRelease,
- SequentiallyConsistent,
-}
-
-pub enum SynchronizationScope {
- // FIXME: figure out if this variant is needed at all.
- #[allow(dead_code)]
- Other,
- SingleThread,
- CrossThread,
-}
-
-#[derive(Copy, Clone, PartialEq, Debug)]
-pub enum TypeKind {
- Void,
- Half,
- Float,
- Double,
- X86_FP80,
- FP128,
- PPC_FP128,
- Label,
- Integer,
- Function,
- Struct,
- Array,
- Pointer,
- Vector,
- Metadata,
- X86_MMX,
- Token,
-}
-
-// FIXME(mw): Anything that is produced via DepGraph::with_task() must implement
-// the HashStable trait. Normally DepGraph::with_task() calls are
-// hidden behind queries, but CGU creation is a special case in two
-// ways: (1) it's not a query and (2) CGU are output nodes, so their
-// Fingerprints are not actually needed. It remains to be clarified
-// how exactly this case will be handled in the red/green system but
-// for now we content ourselves with providing a no-op HashStable
-// implementation for CGUs.
-mod temp_stable_hash_impls {
- use rustc_data_structures::stable_hasher::{StableHasherResult, StableHasher,
- HashStable};
- use ModuleCodegen;
-
- impl<HCX, M> HashStable<HCX> for ModuleCodegen<M> {
- fn hash_stable<W: StableHasherResult>(&self,
- _: &mut HCX,
- _: &mut StableHasher<W>) {
- // do nothing
- }
- }
-}
+++ /dev/null
-// Copyright 2018 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 rustc::ty::layout::{HasTyCtxt, LayoutOf, TyLayout};
-use rustc::ty::Ty;
-
-use super::CodegenObject;
-use rustc::middle::allocator::AllocatorKind;
-use rustc::middle::cstore::EncodedMetadata;
-use rustc::mir::mono::Stats;
-use rustc::session::Session;
-use rustc::ty::TyCtxt;
-use rustc::util::time_graph::TimeGraph;
-use std::any::Any;
-use std::sync::mpsc::Receiver;
-use syntax_pos::symbol::InternedString;
-use ModuleCodegen;
-
-pub trait BackendTypes {
- type Value: CodegenObject;
- type BasicBlock: Copy;
- type Type: CodegenObject;
- type Context;
- type Funclet;
-
- type DIScope: Copy;
-}
-
-pub trait Backend<'tcx>:
- BackendTypes + HasTyCtxt<'tcx> + LayoutOf<Ty = Ty<'tcx>, TyLayout = TyLayout<'tcx>>
-{
-}
-
-impl<'tcx, T> Backend<'tcx> for T where
- Self: BackendTypes + HasTyCtxt<'tcx> + LayoutOf<Ty = Ty<'tcx>, TyLayout = TyLayout<'tcx>>
-{}
-
-pub trait BackendMethods {
- type Module;
- type OngoingCodegen;
-
- fn new_metadata(&self, sess: &Session, mod_name: &str) -> Self::Module;
- fn write_metadata<'b, 'gcx>(
- &self,
- tcx: TyCtxt<'b, 'gcx, 'gcx>,
- metadata: &Self::Module,
- ) -> EncodedMetadata;
- fn codegen_allocator(&self, tcx: TyCtxt, mods: &Self::Module, kind: AllocatorKind);
-
- fn start_async_codegen(
- &self,
- tcx: TyCtxt,
- time_graph: Option<TimeGraph>,
- metadata: EncodedMetadata,
- coordinator_receive: Receiver<Box<dyn Any + Send>>,
- total_cgus: usize,
- ) -> Self::OngoingCodegen;
- fn submit_pre_codegened_module_to_llvm(
- &self,
- codegen: &Self::OngoingCodegen,
- tcx: TyCtxt,
- module: ModuleCodegen<Self::Module>,
- );
- fn codegen_aborted(codegen: Self::OngoingCodegen);
- fn codegen_finished(&self, codegen: &Self::OngoingCodegen, tcx: TyCtxt);
- fn check_for_errors(&self, codegen: &Self::OngoingCodegen, sess: &Session);
- fn wait_for_signal_to_codegen_item(&self, codegen: &Self::OngoingCodegen);
- fn compile_codegen_unit<'a, 'tcx: 'a>(
- &self,
- tcx: TyCtxt<'a, 'tcx, 'tcx>,
- cgu_name: InternedString,
- ) -> Stats;
-}
+++ /dev/null
-// Copyright 2018 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.
-
-mod backend;
-
-pub use self::backend::{Backend, BackendMethods, BackendTypes};
-
-use std::fmt;
-
-pub trait CodegenObject: Copy + PartialEq + fmt::Debug {}
-impl<T: Copy + PartialEq + fmt::Debug> CodegenObject for T {}
use rustc::session::Session;
use rustc::ty::TyCtxt;
-use rustc::dep_graph::WorkProduct;
-use rustc::session::config::{OutputFilenames, OutputType};
pub mod command;
-pub mod interfaces;
pub mod link;
pub mod linker;
pub mod codegen_backend;
pub mod symbol_export;
pub mod symbol_names;
pub mod symbol_names_test;
-pub mod common;
-
-pub struct ModuleCodegen<M> {
- /// The name of the module. When the crate may be saved between
- /// compilations, incremental compilation requires that name be
- /// unique amongst **all** crates. Therefore, it should contain
- /// something unique to this crate (e.g., a module path) as well
- /// as the crate name and disambiguator.
- /// We currently generate these names via CodegenUnit::build_cgu_name().
- pub name: String,
- pub module_llvm: M,
- pub kind: ModuleKind,
-}
-
-pub const RLIB_BYTECODE_EXTENSION: &str = "bc.z";
-
-impl<M> ModuleCodegen<M> {
- pub fn into_compiled_module(self,
- emit_obj: bool,
- emit_bc: bool,
- emit_bc_compressed: bool,
- outputs: &OutputFilenames) -> CompiledModule {
- let object = if emit_obj {
- Some(outputs.temp_path(OutputType::Object, Some(&self.name)))
- } else {
- None
- };
- let bytecode = if emit_bc {
- Some(outputs.temp_path(OutputType::Bitcode, Some(&self.name)))
- } else {
- None
- };
- let bytecode_compressed = if emit_bc_compressed {
- Some(outputs.temp_path(OutputType::Bitcode, Some(&self.name))
- .with_extension(RLIB_BYTECODE_EXTENSION))
- } else {
- None
- };
-
- CompiledModule {
- name: self.name.clone(),
- kind: self.kind,
- object,
- bytecode,
- bytecode_compressed,
- }
- }
-}
-
-#[derive(Debug)]
-pub struct CompiledModule {
- pub name: String,
- pub kind: ModuleKind,
- pub object: Option<PathBuf>,
- pub bytecode: Option<PathBuf>,
- pub bytecode_compressed: Option<PathBuf>,
-}
-
-pub struct CachedModuleCodegen {
- pub name: String,
- pub source: WorkProduct,
-}
-
-#[derive(Copy, Clone, Debug, PartialEq)]
-pub enum ModuleKind {
- Regular,
- Metadata,
- Allocator,
-}
/// check for the #[rustc_error] annotation, which forces an
/// error in codegen. This is used to write compile-fail tests