Skip to content

Commit 6533167

Browse files
committed
Small generalization of some CodegenCx methods
1 parent 29591b5 commit 6533167

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustc_codegen_llvm/context.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ use std::cell::{Cell, RefCell};
3939
use std::iter;
4040
use std::str;
4141
use std::sync::Arc;
42+
use std::hash::Hash;
4243
use syntax::symbol::LocalInternedString;
4344
use abi::Abi;
4445

@@ -104,7 +105,7 @@ pub struct CodegenCx<'a, 'tcx: 'a, V> {
104105
local_gen_sym_counter: Cell<usize>,
105106
}
106107

107-
impl<'a, 'tcx> DepGraphSafe for CodegenCx<'a, 'tcx, &'a Value> {
108+
impl<'a, 'tcx, Value> DepGraphSafe for CodegenCx<'a, 'tcx, Value> {
108109
}
109110

110111
pub fn get_reloc_model(sess: &Session) -> llvm::RelocMode {
@@ -211,11 +212,11 @@ pub unsafe fn create_module(
211212
llmod
212213
}
213214

214-
impl<'a, 'tcx> CodegenCx<'a, 'tcx, &'a Value> {
215+
impl<'a, 'tcx, Value : Eq+Hash> CodegenCx<'a, 'tcx, Value> {
215216
crate fn new(tcx: TyCtxt<'a, 'tcx, 'tcx>,
216217
codegen_unit: Arc<CodegenUnit<'tcx>>,
217218
llvm_module: &'a ::ModuleLlvm)
218-
-> CodegenCx<'a, 'tcx, &'a Value> {
219+
-> CodegenCx<'a, 'tcx, Value> {
219220
// An interesting part of Windows which MSVC forces our hand on (and
220221
// apparently MinGW didn't) is the usage of `dllimport` and `dllexport`
221222
// attributes in LLVM IR as well as native dependencies (in C these

0 commit comments

Comments
 (0)