Skip to content

Commit c785979

Browse files
committed
Moved Backend interface into rustc_codegen_utils
1 parent b8e7061 commit c785979

File tree

18 files changed

+114
-109
lines changed

18 files changed

+114
-109
lines changed

src/librustc_codegen_llvm/back/lto.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ use rustc::session::config::{self, Lto};
2424
use rustc::util::common::time_ext;
2525
use rustc_data_structures::fx::FxHashMap;
2626
use time_graph::Timeline;
27-
use {ModuleCodegen, ModuleLlvm, ModuleKind};
27+
use ModuleLlvm;
28+
use rustc_codegen_utils::{ModuleCodegen, ModuleKind};
2829

2930
use libc;
3031

src/librustc_codegen_llvm/back/write.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ use rustc::util::nodemap::FxHashMap;
2929
use time_graph::{self, TimeGraph, Timeline};
3030
use llvm::{self, DiagnosticInfo, PassManager, SMDiagnostic};
3131
use llvm_util;
32-
use {CodegenResults, ModuleCodegen, CompiledModule, ModuleKind, ModuleLlvm,
33-
CachedModuleCodegen};
32+
use {CodegenResults, ModuleLlvm};
33+
use rustc_codegen_utils::{ModuleCodegen, ModuleKind, CachedModuleCodegen, CompiledModule};
3434
use CrateInfo;
3535
use rustc::hir::def_id::{CrateNum, LOCAL_CRATE};
3636
use rustc::ty::TyCtxt;

src/librustc_codegen_llvm/base.rs

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
//! int) and rec(x=int, y=int, z=int) will have the same llvm::Type.
2525
2626
use super::ModuleLlvm;
27-
use super::ModuleCodegen;
28-
use super::ModuleKind;
29-
use super::CachedModuleCodegen;
27+
use rustc_codegen_utils::{ModuleCodegen, ModuleKind, CachedModuleCodegen};
3028
use super::LlvmCodegenBackend;
3129

3230
use abi;
@@ -1314,25 +1312,3 @@ pub fn visibility_to_llvm(linkage: Visibility) -> llvm::Visibility {
13141312
Visibility::Protected => llvm::Visibility::Protected,
13151313
}
13161314
}
1317-
1318-
// FIXME(mw): Anything that is produced via DepGraph::with_task() must implement
1319-
// the HashStable trait. Normally DepGraph::with_task() calls are
1320-
// hidden behind queries, but CGU creation is a special case in two
1321-
// ways: (1) it's not a query and (2) CGU are output nodes, so their
1322-
// Fingerprints are not actually needed. It remains to be clarified
1323-
// how exactly this case will be handled in the red/green system but
1324-
// for now we content ourselves with providing a no-op HashStable
1325-
// implementation for CGUs.
1326-
mod temp_stable_hash_impls {
1327-
use rustc_data_structures::stable_hasher::{StableHasherResult, StableHasher,
1328-
HashStable};
1329-
use {ModuleCodegen, ModuleLlvm};
1330-
1331-
impl<HCX> HashStable<HCX> for ModuleCodegen<ModuleLlvm> {
1332-
fn hash_stable<W: StableHasherResult>(&self,
1333-
_: &mut HCX,
1334-
_: &mut StableHasher<W>) {
1335-
// do nothing
1336-
}
1337-
}
1338-
}

src/librustc_codegen_llvm/interfaces/abi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use abi::FnType;
1212
use rustc::ty::{FnSig, Ty, Instance};
13-
use super::backend::Backend;
13+
use super::Backend;
1414
use super::builder::HasCodegen;
1515

1616
pub trait AbiMethods<'tcx> {

src/librustc_codegen_llvm/interfaces/asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use rustc::hir::{InlineAsm, GlobalAsm};
1212
use mir::place::PlaceRef;
13-
use super::backend::Backend;
13+
use super::Backend;
1414
use super::builder::HasCodegen;
1515

1616
pub trait AsmBuilderMethods<'a, 'll: 'a, 'tcx: 'll> : HasCodegen<'a, 'll, 'tcx>{

src/librustc_codegen_llvm/interfaces/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use libc::c_char;
1313
use rustc::ty::TyCtxt;
1414
use rustc::ty::layout::{Align, Size};
1515
use builder::MemFlags;
16-
use super::backend::Backend;
16+
use super::Backend;
1717
use super::CodegenMethods;
1818
use super::debuginfo::DebugInfoBuilderMethods;
1919
use super::intrinsic::IntrinsicCallMethods;

src/librustc_codegen_llvm/interfaces/debuginfo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use rustc::ty::{Ty, FnSig};
12-
use super::backend::Backend;
12+
use super::Backend;
1313
use super::builder::HasCodegen;
1414
use rustc::mir;
1515
use monomorphize::Instance;

src/librustc_codegen_llvm/interfaces/declare.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use rustc::ty::Ty;
12-
use super::backend::Backend;
12+
use super::Backend;
1313
use rustc::hir::def_id::DefId;
1414
use rustc::mir::mono::{Linkage, Visibility};
1515
use monomorphize::Instance;

src/librustc_codegen_llvm/interfaces/intrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use super::backend::Backend;
11+
use super::Backend;
1212
use super::builder::HasCodegen;
1313
use mir::operand::OperandRef;
1414
use rustc::ty::Ty;

src/librustc_codegen_llvm/interfaces/misc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use std::cell::RefCell;
1212
use rustc::util::nodemap::FxHashMap;
1313
use rustc::ty::{Ty, self, Instance};
14-
use super::backend::Backend;
14+
use super::Backend;
1515
use rustc::session::Session;
1616
use libc::c_uint;
1717
use rustc::mir::mono::Stats;

0 commit comments

Comments
 (0)