Rollup merge of #58546 - taiki-e:librustc_codegen_llvm-2018, r=Centril
librustc_codegen_llvm => 2018 Transitions `librustc_codegen_llvm` to Rust 2018; cc #58099 r? @Centril
This commit is contained in:
commit
8368638515
@ -2,6 +2,7 @@
|
||||
authors = ["The Rust Project Developers"]
|
||||
name = "rustc_codegen_llvm"
|
||||
version = "0.0.0"
|
||||
edition = "2018"
|
||||
|
||||
[lib]
|
||||
name = "rustc_codegen_llvm"
|
||||
@ -10,7 +11,7 @@ crate-type = ["dylib"]
|
||||
test = false
|
||||
|
||||
[dependencies]
|
||||
cc = "1.0.1"
|
||||
cc = "1.0.1" # Used to locate MSVC
|
||||
num_cpus = "1.0"
|
||||
rustc-demangle = "0.1.4"
|
||||
rustc_llvm = { path = "../librustc_llvm" }
|
||||
|
@ -1,12 +1,12 @@
|
||||
use llvm::{self, AttributePlace};
|
||||
use crate::llvm::{self, AttributePlace};
|
||||
use crate::builder::Builder;
|
||||
use crate::context::CodegenCx;
|
||||
use crate::type_::Type;
|
||||
use crate::type_of::{LayoutLlvmExt, PointerKind};
|
||||
use crate::value::Value;
|
||||
use rustc_codegen_ssa::MemFlags;
|
||||
use builder::Builder;
|
||||
use context::CodegenCx;
|
||||
use rustc_codegen_ssa::mir::place::PlaceRef;
|
||||
use rustc_codegen_ssa::mir::operand::OperandValue;
|
||||
use type_::Type;
|
||||
use type_of::{LayoutLlvmExt, PointerKind};
|
||||
use value::Value;
|
||||
use rustc_target::abi::call::ArgType;
|
||||
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
|
@ -1,13 +1,13 @@
|
||||
use std::ffi::CString;
|
||||
|
||||
use attributes;
|
||||
use crate::attributes;
|
||||
use libc::c_uint;
|
||||
use rustc::middle::allocator::AllocatorKind;
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc_allocator::{ALLOCATOR_METHODS, AllocatorTy};
|
||||
|
||||
use ModuleLlvm;
|
||||
use llvm::{self, False, True};
|
||||
use crate::ModuleLlvm;
|
||||
use crate::llvm::{self, False, True};
|
||||
|
||||
pub(crate) unsafe fn codegen(tcx: TyCtxt, mods: &ModuleLlvm, kind: AllocatorKind) {
|
||||
let llcx = &*mods.llcx;
|
||||
|
@ -1,8 +1,8 @@
|
||||
use llvm;
|
||||
use context::CodegenCx;
|
||||
use type_of::LayoutLlvmExt;
|
||||
use builder::Builder;
|
||||
use value::Value;
|
||||
use crate::llvm;
|
||||
use crate::context::CodegenCx;
|
||||
use crate::type_of::LayoutLlvmExt;
|
||||
use crate::builder::Builder;
|
||||
use crate::value::Value;
|
||||
|
||||
use rustc::hir;
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
|
@ -15,15 +15,15 @@
|
||||
use rustc_target::spec::PanicStrategy;
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
|
||||
use abi::Abi;
|
||||
use attributes;
|
||||
use llvm::{self, Attribute};
|
||||
use llvm::AttributePlace::Function;
|
||||
use llvm_util;
|
||||
use crate::abi::Abi;
|
||||
use crate::attributes;
|
||||
use crate::llvm::{self, Attribute};
|
||||
use crate::llvm::AttributePlace::Function;
|
||||
use crate::llvm_util;
|
||||
pub use syntax::attr::{self, InlineAttr, OptimizeAttr};
|
||||
|
||||
use context::CodegenCx;
|
||||
use value::Value;
|
||||
use crate::context::CodegenCx;
|
||||
use crate::value::Value;
|
||||
|
||||
/// Mark LLVM function to use provided inline heuristic.
|
||||
#[inline]
|
||||
|
@ -7,12 +7,11 @@
|
||||
use std::ptr;
|
||||
use std::str;
|
||||
|
||||
use back::bytecode::RLIB_BYTECODE_EXTENSION;
|
||||
use crate::back::bytecode::RLIB_BYTECODE_EXTENSION;
|
||||
use crate::llvm::archive_ro::{ArchiveRO, Child};
|
||||
use crate::llvm::{self, ArchiveKind};
|
||||
use crate::metadata::METADATA_FILENAME;
|
||||
use rustc_codegen_ssa::back::archive::find_library;
|
||||
use libc;
|
||||
use llvm::archive_ro::{ArchiveRO, Child};
|
||||
use llvm::{self, ArchiveKind};
|
||||
use metadata::METADATA_FILENAME;
|
||||
use rustc::session::Session;
|
||||
|
||||
pub struct ArchiveConfig<'a> {
|
||||
|
@ -1,13 +1,15 @@
|
||||
use back::wasm;
|
||||
use super::archive::{ArchiveBuilder, ArchiveConfig};
|
||||
use super::bytecode::RLIB_BYTECODE_EXTENSION;
|
||||
use super::rpath::RPathConfig;
|
||||
use super::rpath;
|
||||
use crate::back::wasm;
|
||||
use crate::metadata::METADATA_FILENAME;
|
||||
use crate::context::get_reloc_model;
|
||||
use crate::llvm;
|
||||
use rustc_codegen_ssa::back::linker::Linker;
|
||||
use rustc_codegen_ssa::back::link::{remove, ignored_for_lto, each_linked_rlib, linker_and_flavor,
|
||||
get_linker};
|
||||
use rustc_codegen_ssa::back::command::Command;
|
||||
use super::rpath::RPathConfig;
|
||||
use super::rpath;
|
||||
use metadata::METADATA_FILENAME;
|
||||
use rustc::session::config::{self, DebugInfo, OutputFilenames, OutputType, PrintRequest};
|
||||
use rustc::session::config::{RUST_CGU_EXT, Lto, Sanitizer};
|
||||
use rustc::session::filesearch;
|
||||
@ -22,8 +24,6 @@
|
||||
use tempfile::{Builder as TempFileBuilder, TempDir};
|
||||
use rustc_target::spec::{PanicStrategy, RelroLevel, LinkerFlavor};
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use context::get_reloc_model;
|
||||
use llvm;
|
||||
|
||||
use std::ascii;
|
||||
use std::char;
|
||||
@ -523,7 +523,7 @@ fn link_natively(sess: &Session,
|
||||
}
|
||||
|
||||
{
|
||||
let target_cpu = ::llvm_util::target_cpu(sess);
|
||||
let target_cpu = crate::llvm_util::target_cpu(sess);
|
||||
let mut linker = codegen_results.linker_info.to_linker(cmd, &sess, flavor, target_cpu);
|
||||
link_args(&mut *linker, flavor, sess, crate_type, tmpdir,
|
||||
out_filename, codegen_results);
|
||||
|
@ -1,12 +1,15 @@
|
||||
use back::bytecode::{DecodedBytecode, RLIB_BYTECODE_EXTENSION};
|
||||
use crate::back::bytecode::{DecodedBytecode, RLIB_BYTECODE_EXTENSION};
|
||||
use crate::back::write::{self, DiagnosticHandlers, with_llvm_pmb, save_temp_bitcode,
|
||||
to_llvm_opt_settings};
|
||||
use crate::llvm::archive_ro::ArchiveRO;
|
||||
use crate::llvm::{self, True, False};
|
||||
use crate::time_graph::Timeline;
|
||||
use crate::{ModuleLlvm, LlvmCodegenBackend};
|
||||
use rustc_codegen_ssa::back::symbol_export;
|
||||
use rustc_codegen_ssa::back::write::{ModuleConfig, CodegenContext, FatLTOInput};
|
||||
use rustc_codegen_ssa::back::lto::{SerializedModule, LtoModuleCodegen, ThinShared, ThinModule};
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
use back::write::{self, DiagnosticHandlers, with_llvm_pmb, save_temp_bitcode, to_llvm_opt_settings};
|
||||
use errors::{FatalError, Handler};
|
||||
use llvm::archive_ro::ArchiveRO;
|
||||
use llvm::{self, True, False};
|
||||
use rustc::dep_graph::WorkProduct;
|
||||
use rustc::dep_graph::cgu_reuse_tracker::CguReuse;
|
||||
use rustc::hir::def_id::LOCAL_CRATE;
|
||||
@ -14,12 +17,8 @@
|
||||
use rustc::session::config::{self, Lto};
|
||||
use rustc::util::common::time_ext;
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use time_graph::Timeline;
|
||||
use {ModuleLlvm, LlvmCodegenBackend};
|
||||
use rustc_codegen_ssa::{ModuleCodegen, ModuleKind};
|
||||
|
||||
use libc;
|
||||
|
||||
use std::ffi::{CStr, CString};
|
||||
use std::ptr;
|
||||
use std::slice;
|
||||
|
@ -1,28 +1,27 @@
|
||||
use attributes;
|
||||
use back::bytecode::{self, RLIB_BYTECODE_EXTENSION};
|
||||
use back::lto::ThinBuffer;
|
||||
use crate::attributes;
|
||||
use crate::back::bytecode::{self, RLIB_BYTECODE_EXTENSION};
|
||||
use crate::back::lto::ThinBuffer;
|
||||
use crate::base;
|
||||
use crate::consts;
|
||||
use crate::time_graph::Timeline;
|
||||
use crate::llvm::{self, DiagnosticInfo, PassManager, SMDiagnostic};
|
||||
use crate::llvm_util;
|
||||
use crate::ModuleLlvm;
|
||||
use crate::type_::Type;
|
||||
use crate::context::{is_pie_binary, get_reloc_model};
|
||||
use crate::common;
|
||||
use crate::LlvmCodegenBackend;
|
||||
use rustc_codegen_ssa::back::write::{CodegenContext, ModuleConfig, run_assembler};
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
use base;
|
||||
use consts;
|
||||
use rustc::hir::def_id::LOCAL_CRATE;
|
||||
use rustc::session::config::{self, OutputType, Passes, Lto};
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::TyCtxt;
|
||||
use time_graph::Timeline;
|
||||
use llvm::{self, DiagnosticInfo, PassManager, SMDiagnostic};
|
||||
use llvm_util;
|
||||
use ModuleLlvm;
|
||||
use rustc_codegen_ssa::{ModuleCodegen, CompiledModule};
|
||||
use rustc::util::common::time_ext;
|
||||
use rustc_fs_util::{path_to_c_string, link_or_copy};
|
||||
use rustc_data_structures::small_c_str::SmallCStr;
|
||||
use errors::{self, Handler, FatalError};
|
||||
use type_::Type;
|
||||
use context::{is_pie_binary, get_reloc_model};
|
||||
use common;
|
||||
use LlvmCodegenBackend;
|
||||
use rustc_demangle;
|
||||
use errors::{Handler, FatalError};
|
||||
|
||||
use std::ffi::{CString, CStr};
|
||||
use std::fs;
|
||||
|
@ -18,18 +18,18 @@
|
||||
use rustc_codegen_ssa::base::maybe_create_entry_wrapper;
|
||||
use super::LlvmCodegenBackend;
|
||||
|
||||
use llvm;
|
||||
use metadata;
|
||||
use crate::llvm;
|
||||
use crate::metadata;
|
||||
use crate::builder::Builder;
|
||||
use crate::common;
|
||||
use crate::context::CodegenCx;
|
||||
use crate::monomorphize::partitioning::CodegenUnitExt;
|
||||
use rustc::dep_graph;
|
||||
use rustc::mir::mono::{Linkage, Visibility, Stats};
|
||||
use rustc::middle::cstore::{EncodedMetadata};
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc::middle::exported_symbols;
|
||||
use rustc::session::config::{self, DebugInfo};
|
||||
use builder::Builder;
|
||||
use common;
|
||||
use context::CodegenCx;
|
||||
use monomorphize::partitioning::CodegenUnitExt;
|
||||
use rustc_codegen_ssa::mono_item::MonoItemExt;
|
||||
use rustc_data_structures::small_c_str::SmallCStr;
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
use syntax_pos::symbol::InternedString;
|
||||
use rustc::hir::CodegenFnAttrs;
|
||||
|
||||
use value::Value;
|
||||
use crate::value::Value;
|
||||
|
||||
|
||||
pub fn write_metadata<'a, 'gcx>(
|
||||
|
@ -1,12 +1,12 @@
|
||||
use llvm::{AtomicRmwBinOp, AtomicOrdering, SynchronizationScope, AsmDialect};
|
||||
use llvm::{self, False, BasicBlock};
|
||||
use crate::llvm::{AtomicRmwBinOp, AtomicOrdering, SynchronizationScope, AsmDialect};
|
||||
use crate::llvm::{self, False, BasicBlock};
|
||||
use crate::common::Funclet;
|
||||
use crate::context::CodegenCx;
|
||||
use crate::type_::Type;
|
||||
use crate::type_of::LayoutLlvmExt;
|
||||
use crate::value::Value;
|
||||
use rustc_codegen_ssa::common::{IntPredicate, TypeKind, RealPredicate};
|
||||
use rustc_codegen_ssa::{self, MemFlags};
|
||||
use common::Funclet;
|
||||
use context::CodegenCx;
|
||||
use type_::Type;
|
||||
use type_of::LayoutLlvmExt;
|
||||
use value::Value;
|
||||
use rustc_codegen_ssa::MemFlags;
|
||||
use libc::{c_uint, c_char};
|
||||
use rustc::ty::{self, Ty, TyCtxt};
|
||||
use rustc::ty::layout::{self, Align, Size, TyLayout};
|
||||
@ -14,7 +14,6 @@
|
||||
use rustc::session::config;
|
||||
use rustc_data_structures::small_c_str::SmallCStr;
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
use syntax;
|
||||
use rustc_codegen_ssa::base::to_immediate;
|
||||
use rustc_codegen_ssa::mir::operand::{OperandValue, OperandRef};
|
||||
use rustc_codegen_ssa::mir::place::PlaceRef;
|
||||
|
@ -4,11 +4,11 @@
|
||||
//! and methods are represented as just a fn ptr and not a full
|
||||
//! closure.
|
||||
|
||||
use attributes;
|
||||
use llvm;
|
||||
use monomorphize::Instance;
|
||||
use context::CodegenCx;
|
||||
use value::Value;
|
||||
use crate::attributes;
|
||||
use crate::llvm;
|
||||
use crate::monomorphize::Instance;
|
||||
use crate::context::CodegenCx;
|
||||
use crate::value::Value;
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
|
||||
use rustc::ty::TypeFoldable;
|
||||
|
@ -2,17 +2,17 @@
|
||||
|
||||
//! Code that is useful in various codegen modules.
|
||||
|
||||
use llvm::{self, True, False, Bool, BasicBlock, OperandBundleDef};
|
||||
use abi;
|
||||
use consts;
|
||||
use type_::Type;
|
||||
use type_of::LayoutLlvmExt;
|
||||
use value::Value;
|
||||
use crate::llvm::{self, True, False, Bool, BasicBlock, OperandBundleDef};
|
||||
use crate::abi;
|
||||
use crate::consts;
|
||||
use crate::type_::Type;
|
||||
use crate::type_of::LayoutLlvmExt;
|
||||
use crate::value::Value;
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
|
||||
use crate::consts::const_alloc_to_llvm;
|
||||
use rustc::ty::layout::{HasDataLayout, LayoutOf, self, TyLayout, Size};
|
||||
use rustc::mir::interpret::{Scalar, AllocKind, Allocation};
|
||||
use consts::const_alloc_to_llvm;
|
||||
use rustc_codegen_ssa::mir::place::PlaceRef;
|
||||
|
||||
use libc::{c_uint, c_char};
|
||||
@ -20,7 +20,7 @@
|
||||
use syntax::symbol::LocalInternedString;
|
||||
use syntax::ast::Mutability;
|
||||
|
||||
pub use context::CodegenCx;
|
||||
pub use crate::context::CodegenCx;
|
||||
|
||||
/*
|
||||
* A note on nomenclature of linking: "extern", "foreign", and "upcall".
|
||||
|
@ -1,20 +1,20 @@
|
||||
use crate::llvm::{self, SetUnnamedAddr, True};
|
||||
use crate::debuginfo;
|
||||
use crate::monomorphize::MonoItem;
|
||||
use crate::common::CodegenCx;
|
||||
use crate::monomorphize::Instance;
|
||||
use crate::base;
|
||||
use crate::type_::Type;
|
||||
use crate::type_of::LayoutLlvmExt;
|
||||
use crate::value::Value;
|
||||
use libc::c_uint;
|
||||
use llvm::{self, SetUnnamedAddr, True};
|
||||
use rustc::hir::def_id::DefId;
|
||||
use rustc::mir::interpret::{ConstValue, Allocation, read_target_uint,
|
||||
Pointer, ErrorHandled, GlobalId};
|
||||
use rustc::hir::Node;
|
||||
use debuginfo;
|
||||
use monomorphize::MonoItem;
|
||||
use common::CodegenCx;
|
||||
use monomorphize::Instance;
|
||||
use syntax_pos::Span;
|
||||
use rustc_target::abi::HasDataLayout;
|
||||
use syntax_pos::symbol::LocalInternedString;
|
||||
use base;
|
||||
use type_::Type;
|
||||
use type_of::LayoutLlvmExt;
|
||||
use value::Value;
|
||||
use rustc::ty::{self, Ty};
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
use attributes;
|
||||
use llvm;
|
||||
use crate::attributes;
|
||||
use crate::llvm;
|
||||
use crate::debuginfo;
|
||||
use crate::monomorphize::Instance;
|
||||
use crate::value::Value;
|
||||
use rustc::dep_graph::DepGraphSafe;
|
||||
use rustc::hir;
|
||||
use debuginfo;
|
||||
use monomorphize::Instance;
|
||||
use value::Value;
|
||||
|
||||
use monomorphize::partitioning::CodegenUnit;
|
||||
use type_::Type;
|
||||
use type_of::PointeeInfo;
|
||||
use crate::monomorphize::partitioning::CodegenUnit;
|
||||
use crate::type_::Type;
|
||||
use crate::type_of::PointeeInfo;
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
use libc::c_uint;
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
use rustc_target::spec::{HasTargetSpec, Target};
|
||||
use rustc_codegen_ssa::callee::resolve_and_get_fn;
|
||||
use rustc_codegen_ssa::base::wants_msvc_seh;
|
||||
use callee::get_fn;
|
||||
use crate::callee::get_fn;
|
||||
|
||||
use std::ffi::CStr;
|
||||
use std::cell::{Cell, RefCell};
|
||||
@ -31,7 +31,7 @@
|
||||
use std::str;
|
||||
use std::sync::Arc;
|
||||
use syntax::symbol::LocalInternedString;
|
||||
use abi::Abi;
|
||||
use crate::abi::Abi;
|
||||
|
||||
/// There is one `CodegenCx` per compilation unit. Each one has its own LLVM
|
||||
/// `llvm::Context` so that several compilation units may be optimized in parallel.
|
||||
@ -103,7 +103,7 @@ pub fn get_reloc_model(sess: &Session) -> llvm::RelocMode {
|
||||
None => &sess.target.target.options.relocation_model[..],
|
||||
};
|
||||
|
||||
match ::back::write::RELOC_MODEL_ARGS.iter().find(
|
||||
match crate::back::write::RELOC_MODEL_ARGS.iter().find(
|
||||
|&&arg| arg.0 == reloc_model_arg) {
|
||||
Some(x) => x.1,
|
||||
_ => {
|
||||
@ -121,7 +121,7 @@ fn get_tls_model(sess: &Session) -> llvm::ThreadLocalMode {
|
||||
None => &sess.target.target.options.tls_model[..],
|
||||
};
|
||||
|
||||
match ::back::write::TLS_MODEL_ARGS.iter().find(
|
||||
match crate::back::write::TLS_MODEL_ARGS.iter().find(
|
||||
|&&arg| arg.0 == tls_model_arg) {
|
||||
Some(x) => x.1,
|
||||
_ => {
|
||||
@ -154,7 +154,7 @@ pub unsafe fn create_module(
|
||||
|
||||
// Ensure the data-layout values hardcoded remain the defaults.
|
||||
if sess.target.target.options.is_builtin {
|
||||
let tm = ::back::write::create_target_machine(tcx, false);
|
||||
let tm = crate::back::write::create_target_machine(tcx, false);
|
||||
llvm::LLVMRustSetDataLayoutFromTargetMachine(llmod, tm);
|
||||
llvm::LLVMRustDisposeTargetMachine(tm);
|
||||
|
||||
@ -212,7 +212,7 @@ pub unsafe fn create_module(
|
||||
impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> {
|
||||
crate fn new(tcx: TyCtxt<'ll, 'tcx, 'tcx>,
|
||||
codegen_unit: Arc<CodegenUnit<'tcx>>,
|
||||
llvm_module: &'ll ::ModuleLlvm)
|
||||
llvm_module: &'ll crate::ModuleLlvm)
|
||||
-> Self {
|
||||
// An interesting part of Windows which MSVC forces our hand on (and
|
||||
// apparently MinGW didn't) is the usage of `dllimport` and `dllexport`
|
||||
@ -377,7 +377,7 @@ fn eh_personality(&self) -> &'ll Value {
|
||||
// Returns a Value of the "eh_unwind_resume" lang item if one is defined,
|
||||
// otherwise declares it as an external function.
|
||||
fn eh_unwind_resume(&self) -> &'ll Value {
|
||||
use attributes;
|
||||
use crate::attributes;
|
||||
let unwresume = &self.eh_unwind_resume;
|
||||
if let Some(llfn) = unwresume.get() {
|
||||
return llfn;
|
||||
|
@ -2,9 +2,9 @@
|
||||
use super::metadata::file_metadata;
|
||||
use super::utils::{DIB, span_start};
|
||||
|
||||
use llvm;
|
||||
use llvm::debuginfo::{DIScope, DISubprogram};
|
||||
use common::CodegenCx;
|
||||
use crate::llvm;
|
||||
use crate::llvm::debuginfo::{DIScope, DISubprogram};
|
||||
use crate::common::CodegenCx;
|
||||
use rustc::mir::{Mir, SourceScope};
|
||||
|
||||
use libc::c_uint;
|
||||
|
@ -1,11 +1,11 @@
|
||||
// .debug_gdb_scripts binary section.
|
||||
|
||||
use llvm;
|
||||
use crate::llvm;
|
||||
|
||||
use common::CodegenCx;
|
||||
use builder::Builder;
|
||||
use crate::common::CodegenCx;
|
||||
use crate::builder::Builder;
|
||||
use crate::value::Value;
|
||||
use rustc::session::config::DebugInfo;
|
||||
use value::Value;
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
|
||||
use syntax::attr;
|
||||
|
@ -7,15 +7,16 @@
|
||||
use super::namespace::mangled_name_of_instance;
|
||||
use super::type_names::compute_debuginfo_type_name;
|
||||
use super::{CrateDebugContext};
|
||||
use crate::abi;
|
||||
use crate::value::Value;
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
use abi;
|
||||
use value::Value;
|
||||
|
||||
use llvm;
|
||||
use llvm::debuginfo::{DIArray, DIType, DIFile, DIScope, DIDescriptor,
|
||||
use crate::llvm;
|
||||
use crate::llvm::debuginfo::{DIArray, DIType, DIFile, DIScope, DIDescriptor,
|
||||
DICompositeType, DILexicalBlock, DIFlags, DebugEmissionKind};
|
||||
use llvm_util;
|
||||
use crate::llvm_util;
|
||||
|
||||
use crate::common::CodegenCx;
|
||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||
use rustc::hir::CodegenFnAttrFlags;
|
||||
use rustc::hir::def::CtorKind;
|
||||
@ -23,7 +24,6 @@
|
||||
use rustc::ich::NodeIdHashingMode;
|
||||
use rustc_data_structures::fingerprint::Fingerprint;
|
||||
use rustc::ty::Instance;
|
||||
use common::CodegenCx;
|
||||
use rustc::ty::{self, AdtKind, ParamEnv, Ty, TyCtxt};
|
||||
use rustc::ty::layout::{self, Align, Integer, IntegerExt, LayoutOf,
|
||||
PrimitiveExt, Size, TyLayout};
|
||||
|
@ -10,24 +10,24 @@
|
||||
use self::metadata::{type_metadata, file_metadata, TypeMap};
|
||||
use self::source_loc::InternalDebugLocation::{self, UnknownLocation};
|
||||
|
||||
use llvm;
|
||||
use llvm::debuginfo::{DIFile, DIType, DIScope, DIBuilder, DISubprogram, DIArray, DIFlags,
|
||||
use crate::llvm;
|
||||
use crate::llvm::debuginfo::{DIFile, DIType, DIScope, DIBuilder, DISubprogram, DIArray, DIFlags,
|
||||
DISPFlags, DILexicalBlock};
|
||||
use rustc::hir::CodegenFnAttrFlags;
|
||||
use rustc::hir::def_id::{DefId, CrateNum, LOCAL_CRATE};
|
||||
use rustc::ty::subst::{Substs, UnpackedKind};
|
||||
|
||||
use abi::Abi;
|
||||
use common::CodegenCx;
|
||||
use builder::Builder;
|
||||
use monomorphize::Instance;
|
||||
use crate::abi::Abi;
|
||||
use crate::common::CodegenCx;
|
||||
use crate::builder::Builder;
|
||||
use crate::monomorphize::Instance;
|
||||
use crate::value::Value;
|
||||
use rustc::ty::{self, ParamEnv, Ty, InstanceDef};
|
||||
use rustc::mir;
|
||||
use rustc::session::config::{self, DebugInfo};
|
||||
use rustc::util::nodemap::{DefIdMap, FxHashMap, FxHashSet};
|
||||
use rustc_data_structures::small_c_str::SmallCStr;
|
||||
use rustc_data_structures::indexed_vec::IndexVec;
|
||||
use value::Value;
|
||||
use rustc_codegen_ssa::debuginfo::{FunctionDebugContext, MirDebugScope, VariableAccess,
|
||||
VariableKind, FunctionDebugContextData};
|
||||
|
||||
|
@ -2,14 +2,14 @@
|
||||
|
||||
use super::metadata::{unknown_file_metadata, UNKNOWN_LINE_NUMBER};
|
||||
use super::utils::{DIB, debug_context};
|
||||
use monomorphize::Instance;
|
||||
use crate::monomorphize::Instance;
|
||||
use rustc::ty;
|
||||
|
||||
use llvm;
|
||||
use llvm::debuginfo::DIScope;
|
||||
use crate::llvm;
|
||||
use crate::llvm::debuginfo::DIScope;
|
||||
use crate::common::CodegenCx;
|
||||
use rustc::hir::def_id::DefId;
|
||||
use rustc::hir::map::DefPathData;
|
||||
use common::CodegenCx;
|
||||
|
||||
use rustc_data_structures::small_c_str::SmallCStr;
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
use super::metadata::UNKNOWN_COLUMN_NUMBER;
|
||||
use rustc_codegen_ssa::debuginfo::FunctionDebugContext;
|
||||
|
||||
use llvm;
|
||||
use llvm::debuginfo::DIScope;
|
||||
use builder::Builder;
|
||||
use crate::llvm;
|
||||
use crate::llvm::debuginfo::DIScope;
|
||||
use crate::builder::Builder;
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
|
||||
use libc::c_uint;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Type Names for Debug Info.
|
||||
|
||||
use common::CodegenCx;
|
||||
use crate::common::CodegenCx;
|
||||
use rustc::hir::def_id::DefId;
|
||||
use rustc::ty::subst::Substs;
|
||||
use rustc::ty::{self, Ty};
|
||||
@ -125,7 +125,7 @@ pub fn push_debuginfo_type_name<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,
|
||||
}
|
||||
|
||||
let abi = sig.abi();
|
||||
if abi != ::abi::Abi::Rust {
|
||||
if abi != crate::abi::Abi::Rust {
|
||||
output.push_str("extern \"");
|
||||
output.push_str(abi.name());
|
||||
output.push_str("\" ");
|
||||
|
@ -6,12 +6,12 @@
|
||||
use rustc::hir::def_id::DefId;
|
||||
use rustc::ty::DefIdTree;
|
||||
|
||||
use llvm;
|
||||
use llvm::debuginfo::{DIScope, DIBuilder, DIDescriptor, DIArray};
|
||||
use common::{CodegenCx};
|
||||
use crate::llvm;
|
||||
use crate::llvm::debuginfo::{DIScope, DIBuilder, DIDescriptor, DIArray};
|
||||
use crate::common::{CodegenCx};
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
|
||||
use syntax_pos::{self, Span};
|
||||
use syntax_pos::Span;
|
||||
|
||||
pub fn is_node_local_to_unit(cx: &CodegenCx, def_id: DefId) -> bool
|
||||
{
|
||||
|
@ -11,18 +11,18 @@
|
||||
//! * Use define_* family of methods when you might be defining the Value.
|
||||
//! * When in doubt, define.
|
||||
|
||||
use llvm;
|
||||
use llvm::AttributePlace::Function;
|
||||
use crate::llvm;
|
||||
use crate::llvm::AttributePlace::Function;
|
||||
use crate::abi::{FnType, FnTypeExt};
|
||||
use crate::attributes;
|
||||
use crate::context::CodegenCx;
|
||||
use crate::type_::Type;
|
||||
use crate::value::Value;
|
||||
use rustc::ty::{self, PolyFnSig};
|
||||
use rustc::ty::layout::LayoutOf;
|
||||
use rustc::session::config::Sanitizer;
|
||||
use rustc_data_structures::small_c_str::SmallCStr;
|
||||
use abi::{FnType, FnTypeExt};
|
||||
use attributes;
|
||||
use context::CodegenCx;
|
||||
use type_::Type;
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
use value::Value;
|
||||
|
||||
/// Declare a function.
|
||||
///
|
||||
|
@ -1,26 +1,26 @@
|
||||
#![allow(non_upper_case_globals)]
|
||||
|
||||
use attributes;
|
||||
use llvm;
|
||||
use llvm_util;
|
||||
use abi::{Abi, FnType, LlvmType, PassMode};
|
||||
use crate::attributes;
|
||||
use crate::llvm;
|
||||
use crate::llvm_util;
|
||||
use crate::abi::{Abi, FnType, LlvmType, PassMode};
|
||||
use crate::context::CodegenCx;
|
||||
use crate::type_::Type;
|
||||
use crate::type_of::LayoutLlvmExt;
|
||||
use crate::builder::Builder;
|
||||
use crate::value::Value;
|
||||
use crate::va_arg::emit_va_arg;
|
||||
use rustc_codegen_ssa::MemFlags;
|
||||
use rustc_codegen_ssa::mir::place::PlaceRef;
|
||||
use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
|
||||
use rustc_codegen_ssa::glue;
|
||||
use rustc_codegen_ssa::base::{to_immediate, wants_msvc_seh, compare_simd_types};
|
||||
use context::CodegenCx;
|
||||
use type_::Type;
|
||||
use type_of::LayoutLlvmExt;
|
||||
use rustc::ty::{self, Ty};
|
||||
use rustc::ty::layout::{self, LayoutOf, HasTyCtxt, Primitive};
|
||||
use rustc_codegen_ssa::common::{IntPredicate, TypeKind};
|
||||
use rustc::hir;
|
||||
use syntax::ast::{self, FloatTy};
|
||||
use syntax::symbol::Symbol;
|
||||
use builder::Builder;
|
||||
use value::Value;
|
||||
use va_arg::emit_va_arg;
|
||||
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
|
||||
|
@ -21,6 +21,9 @@
|
||||
#![feature(concat_idents)]
|
||||
#![feature(link_args)]
|
||||
#![feature(static_nobundle)]
|
||||
#![deny(rust_2018_idioms)]
|
||||
#![allow(explicit_outlives_requirements)]
|
||||
#![allow(elided_lifetimes_in_paths)]
|
||||
|
||||
use back::write::create_target_machine;
|
||||
use syntax_pos::symbol::Symbol;
|
||||
@ -29,16 +32,11 @@
|
||||
#[macro_use] extern crate bitflags;
|
||||
extern crate libc;
|
||||
#[macro_use] extern crate rustc;
|
||||
extern crate jobserver;
|
||||
extern crate num_cpus;
|
||||
extern crate rustc_mir;
|
||||
extern crate rustc_allocator;
|
||||
extern crate rustc_apfloat;
|
||||
extern crate rustc_target;
|
||||
#[macro_use] extern crate rustc_data_structures;
|
||||
extern crate rustc_demangle;
|
||||
extern crate rustc_incremental;
|
||||
extern crate rustc_llvm;
|
||||
extern crate rustc_codegen_utils;
|
||||
extern crate rustc_codegen_ssa;
|
||||
extern crate rustc_fs_util;
|
||||
@ -48,9 +46,7 @@
|
||||
extern crate syntax_pos;
|
||||
extern crate rustc_errors as errors;
|
||||
extern crate serialize;
|
||||
extern crate cc; // Used to locate MSVC
|
||||
extern crate tempfile;
|
||||
extern crate memmap;
|
||||
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
use rustc_codegen_ssa::back::write::{CodegenContext, ModuleConfig, FatLTOInput};
|
||||
|
@ -4,7 +4,7 @@
|
||||
pub use self::Diagnostic::*;
|
||||
|
||||
use libc::c_uint;
|
||||
use value::Value;
|
||||
use crate::value::Value;
|
||||
|
||||
use super::{DiagnosticInfo, Twine};
|
||||
|
||||
|
@ -9,8 +9,6 @@
|
||||
use libc::{c_ulonglong, c_void};
|
||||
|
||||
use std::marker::PhantomData;
|
||||
use syntax;
|
||||
use rustc_codegen_ssa;
|
||||
|
||||
use super::RustString;
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
use std::slice;
|
||||
use std::ffi::CStr;
|
||||
use std::cell::RefCell;
|
||||
use libc::{self, c_uint, c_char, size_t};
|
||||
use libc::{c_uint, c_char, size_t};
|
||||
use rustc_data_structures::small_c_str::SmallCStr;
|
||||
|
||||
pub mod archive_ro;
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::back::write::create_informational_target_machine;
|
||||
use crate::llvm;
|
||||
use syntax_pos::symbol::Symbol;
|
||||
use back::write::create_informational_target_machine;
|
||||
use llvm;
|
||||
use rustc::session::Session;
|
||||
use rustc::session::config::PrintRequest;
|
||||
use rustc_target::spec::MergeFunctions;
|
||||
|
@ -1,8 +1,8 @@
|
||||
use crate::llvm;
|
||||
use crate::llvm::{False, ObjectFile, mk_section_iter};
|
||||
use crate::llvm::archive_ro::ArchiveRO;
|
||||
use rustc::middle::cstore::MetadataLoader;
|
||||
use rustc_target::spec::Target;
|
||||
use llvm;
|
||||
use llvm::{False, ObjectFile, mk_section_iter};
|
||||
use llvm::archive_ro::ArchiveRO;
|
||||
|
||||
use rustc_data_structures::owning_ref::OwningRef;
|
||||
use std::path::Path;
|
||||
|
@ -1,9 +1,9 @@
|
||||
use attributes;
|
||||
use base;
|
||||
use context::CodegenCx;
|
||||
use llvm;
|
||||
use monomorphize::Instance;
|
||||
use type_of::LayoutLlvmExt;
|
||||
use crate::attributes;
|
||||
use crate::base;
|
||||
use crate::context::CodegenCx;
|
||||
use crate::llvm;
|
||||
use crate::monomorphize::Instance;
|
||||
use crate::type_of::LayoutLlvmExt;
|
||||
use rustc::hir::def_id::{DefId, LOCAL_CRATE};
|
||||
use rustc::mir::mono::{Linkage, Visibility};
|
||||
use rustc::ty::TypeFoldable;
|
||||
|
@ -1,22 +1,22 @@
|
||||
#![allow(non_upper_case_globals)]
|
||||
|
||||
pub use llvm::Type;
|
||||
pub use crate::llvm::Type;
|
||||
|
||||
use llvm;
|
||||
use llvm::{Bool, False, True};
|
||||
use context::CodegenCx;
|
||||
use crate::llvm;
|
||||
use crate::llvm::{Bool, False, True};
|
||||
use crate::context::CodegenCx;
|
||||
use crate::value::Value;
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
use value::Value;
|
||||
|
||||
use crate::common;
|
||||
use crate::type_of::LayoutLlvmExt;
|
||||
use crate::abi::{LlvmType, FnTypeExt};
|
||||
use rustc::util::nodemap::FxHashMap;
|
||||
use rustc::ty::Ty;
|
||||
use rustc::ty::layout::TyLayout;
|
||||
use rustc_target::abi::call::{CastTarget, FnType, Reg};
|
||||
use rustc_data_structures::small_c_str::SmallCStr;
|
||||
use common;
|
||||
use rustc_codegen_ssa::common::TypeKind;
|
||||
use type_of::LayoutLlvmExt;
|
||||
use abi::{LlvmType, FnTypeExt};
|
||||
|
||||
use std::fmt;
|
||||
use std::cell::RefCell;
|
||||
|
@ -1,12 +1,12 @@
|
||||
use abi::{FnType, FnTypeExt};
|
||||
use common::*;
|
||||
use crate::abi::{FnType, FnTypeExt};
|
||||
use crate::common::*;
|
||||
use crate::type_::Type;
|
||||
use rustc::hir;
|
||||
use rustc::ty::{self, Ty, TypeFoldable};
|
||||
use rustc::ty::layout::{self, Align, LayoutOf, Size, TyLayout};
|
||||
use rustc_target::abi::FloatTy;
|
||||
use rustc_mir::monomorphize::item::DefPathBasedNames;
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
use type_::Type;
|
||||
|
||||
use std::fmt::Write;
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
use builder::Builder;
|
||||
use crate::builder::Builder;
|
||||
use crate::type_::Type;
|
||||
use crate::type_of::LayoutLlvmExt;
|
||||
use crate::value::Value;
|
||||
use rustc_codegen_ssa::mir::operand::OperandRef;
|
||||
use rustc_codegen_ssa::traits::{BaseTypeMethods, BuilderMethods, ConstMethods, DerivedTypeMethods};
|
||||
use rustc::ty::layout::{Align, HasDataLayout, HasTyCtxt, LayoutOf, Size};
|
||||
use rustc::ty::Ty;
|
||||
use type_::Type;
|
||||
use type_of::LayoutLlvmExt;
|
||||
use value::Value;
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn round_pointer_up_to_alignment(
|
||||
|
@ -1,6 +1,6 @@
|
||||
pub use llvm::Value;
|
||||
pub use crate::llvm::Value;
|
||||
|
||||
use llvm;
|
||||
use crate::llvm;
|
||||
|
||||
use std::fmt;
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
Loading…
Reference in New Issue
Block a user