Skip to content

Commit

Permalink
Move some filename constants to cg_ssa
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Apr 20, 2019
1 parent 8a88379 commit 892c88b
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/librustc_codegen_llvm/back/archive.rs
Expand Up @@ -7,10 +7,9 @@ use std::path::{Path, PathBuf};
use std::ptr;
use std::str;

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::{METADATA_FILENAME, RLIB_BYTECODE_EXTENSION};
use rustc_codegen_ssa::back::archive::find_library;
use rustc::session::Session;

Expand Down
2 changes: 0 additions & 2 deletions src/librustc_codegen_llvm/back/bytecode.rs
Expand Up @@ -37,8 +37,6 @@ pub const RLIB_BYTECODE_OBJECT_MAGIC: &[u8] = b"RUST_OBJECT";
// The version number this compiler will write to bytecode objects in rlibs
pub const RLIB_BYTECODE_OBJECT_VERSION: u8 = 2;

pub const RLIB_BYTECODE_EXTENSION: &str = "bc.z";

pub fn encode(identifier: &str, bytecode: &[u8]) -> Vec<u8> {
let mut encoded = Vec::new();

Expand Down
3 changes: 1 addition & 2 deletions src/librustc_codegen_llvm/back/link.rs
@@ -1,11 +1,10 @@
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::{METADATA_FILENAME, RLIB_BYTECODE_EXTENSION};
use rustc_codegen_ssa::back::linker::Linker;
use rustc_codegen_ssa::back::link::*;
use rustc_codegen_ssa::back::command::Command;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_codegen_llvm/back/lto.rs
@@ -1,4 +1,4 @@
use crate::back::bytecode::{DecodedBytecode, RLIB_BYTECODE_EXTENSION};
use crate::back::bytecode::DecodedBytecode;
use crate::back::write::{self, DiagnosticHandlers, with_llvm_pmb, save_temp_bitcode,
to_llvm_opt_settings};
use crate::llvm::archive_ro::ArchiveRO;
Expand All @@ -16,7 +16,7 @@ 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 rustc_codegen_ssa::{ModuleCodegen, ModuleKind};
use rustc_codegen_ssa::{RLIB_BYTECODE_EXTENSION, ModuleCodegen, ModuleKind};

use std::ffi::{CStr, CString};
use std::ptr;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_codegen_llvm/back/write.rs
@@ -1,5 +1,5 @@
use crate::attributes;
use crate::back::bytecode::{self, RLIB_BYTECODE_EXTENSION};
use crate::back::bytecode;
use crate::back::lto::ThinBuffer;
use crate::base;
use crate::consts;
Expand All @@ -16,7 +16,7 @@ use rustc_codegen_ssa::traits::*;
use rustc::session::config::{self, OutputType, Passes, Lto, PgoGenerate};
use rustc::session::Session;
use rustc::ty::TyCtxt;
use rustc_codegen_ssa::{ModuleCodegen, CompiledModule};
use rustc_codegen_ssa::{RLIB_BYTECODE_EXTENSION, 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;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_codegen_llvm/metadata.rs
Expand Up @@ -5,15 +5,15 @@ use rustc::middle::cstore::MetadataLoader;
use rustc_target::spec::Target;

use rustc_data_structures::owning_ref::OwningRef;
use rustc_codegen_ssa::METADATA_FILENAME;

use std::path::Path;
use std::ptr;
use std::slice;
use rustc_fs_util::path_to_c_string;

pub use rustc_data_structures::sync::MetadataRef;

pub const METADATA_FILENAME: &str = "rust.metadata.bin";

pub struct LlvmMetadataLoader;

impl MetadataLoader for LlvmMetadataLoader {
Expand Down
1 change: 1 addition & 0 deletions src/librustc_codegen_ssa/lib.rs
Expand Up @@ -66,6 +66,7 @@ pub struct ModuleCodegen<M> {
pub kind: ModuleKind,
}

pub const METADATA_FILENAME: &str = "rust.metadata.bin";
pub const RLIB_BYTECODE_EXTENSION: &str = "bc.z";

impl<M> ModuleCodegen<M> {
Expand Down

0 comments on commit 892c88b

Please sign in to comment.