Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librustc_codegen_llvm => 2018 #58546

Merged
merged 1 commit into from
Feb 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/librustc_codegen_llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
authors = ["The Rust Project Developers"]
name = "rustc_codegen_llvm"
version = "0.0.0"
edition = "2018"

[lib]
name = "rustc_codegen_llvm"
Expand All @@ -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" }
Expand Down
12 changes: 6 additions & 6 deletions src/librustc_codegen_llvm/abi.rs
Original file line number Diff line number Diff line change
@@ -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::*;
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_codegen_llvm/allocator.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
10 changes: 5 additions & 5 deletions src/librustc_codegen_llvm/asm.rs
Original file line number Diff line number Diff line change
@@ -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::*;
Expand Down
14 changes: 7 additions & 7 deletions src/librustc_codegen_llvm/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ use rustc_data_structures::fx::FxHashMap;
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]
Expand Down
9 changes: 4 additions & 5 deletions src/librustc_codegen_llvm/back/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ use std::path::{Path, PathBuf};
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> {
Expand Down
14 changes: 7 additions & 7 deletions src/librustc_codegen_llvm/back/link.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -22,8 +24,6 @@ use rustc::hir::def_id::CrateNum;
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;
Expand Down Expand Up @@ -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);
Expand Down
15 changes: 7 additions & 8 deletions src/librustc_codegen_llvm/back/lto.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
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;
use rustc::middle::exported_symbols::SymbolExportLevel;
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;
Expand Down
29 changes: 14 additions & 15 deletions src/librustc_codegen_llvm/back/write.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
14 changes: 7 additions & 7 deletions src/librustc_codegen_llvm/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ use rustc_codegen_ssa::{ModuleCodegen, ModuleKind};
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;

Expand All @@ -41,7 +41,7 @@ use std::time::Instant;
use syntax_pos::symbol::InternedString;
use rustc::hir::CodegenFnAttrs;

use value::Value;
use crate::value::Value;


pub fn write_metadata<'a, 'gcx>(
Expand Down
17 changes: 8 additions & 9 deletions src/librustc_codegen_llvm/builder.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
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};
use rustc::hir::def_id::DefId;
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;
Expand Down
10 changes: 5 additions & 5 deletions src/librustc_codegen_llvm/callee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
16 changes: 8 additions & 8 deletions src/librustc_codegen_llvm/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

//! 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};

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".
Expand Down
18 changes: 9 additions & 9 deletions src/librustc_codegen_llvm/consts.rs
Original file line number Diff line number Diff line change
@@ -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::*;

Expand Down
Loading