diff --git a/src/librustc_codegen_llvm/base.rs b/src/librustc_codegen_llvm/base.rs index a1ec133214a2f..78693a395b390 100644 --- a/src/librustc_codegen_llvm/base.rs +++ b/src/librustc_codegen_llvm/base.rs @@ -180,17 +180,17 @@ pub fn compile_codegen_unit<'ll, 'tcx>(tcx: TyCtxt<'ll, 'tcx, 'tcx>, let mono_items = cx.codegen_unit .items_in_deterministic_order(cx.tcx); for &(mono_item, (linkage, visibility)) in &mono_items { - mono_item.predefine::>(&cx, linkage, visibility); + mono_item.predefine::(&cx, linkage, visibility); } // ... and now that we have everything pre-defined, fill out those definitions. for &(mono_item, _) in &mono_items { - mono_item.define::>(&cx); + mono_item.define::(&cx); } // If this codegen unit contains the main function, also create the // wrapper here - maybe_create_entry_wrapper::>(&cx); + maybe_create_entry_wrapper::(&cx); // Run replace-all-uses-with for statics that need it for &(old_g, new_g) in cx.statics_to_rauw().borrow().iter() { diff --git a/src/librustc_codegen_llvm/builder.rs b/src/librustc_codegen_llvm/builder.rs index a71fe781f6a39..34e4f4d7e1835 100644 --- a/src/librustc_codegen_llvm/builder.rs +++ b/src/librustc_codegen_llvm/builder.rs @@ -34,12 +34,12 @@ use std::ptr; // All Builders must have an llfn associated with them #[must_use] -pub struct Builder<'a, 'll: 'a, 'tcx: 'll, V: 'll = &'ll Value> { +pub struct Builder<'a, 'll: 'a, 'tcx: 'll> { pub llbuilder: &'ll mut llvm::Builder<'ll>, - pub cx: &'a CodegenCx<'ll, 'tcx, V>, + pub cx: &'a CodegenCx<'ll, 'tcx>, } -impl Drop for Builder<'a, 'll, 'tcx, V> { +impl Drop for Builder<'a, 'll, 'tcx> { fn drop(&mut self) { unsafe { llvm::LLVMDisposeBuilder(&mut *(self.llbuilder as *mut _)); diff --git a/src/librustc_codegen_llvm/context.rs b/src/librustc_codegen_llvm/context.rs index 4a7ef9f8374ef..5b088ad290810 100644 --- a/src/librustc_codegen_llvm/context.rs +++ b/src/librustc_codegen_llvm/context.rs @@ -47,7 +47,7 @@ use 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. /// All other LLVM data structures in the `CodegenCx` are tied to that `llvm::Context`. -pub struct CodegenCx<'ll, 'tcx: 'll, V = &'ll Value> { +pub struct CodegenCx<'ll, 'tcx: 'll> { pub tcx: TyCtxt<'ll, 'tcx, 'tcx>, pub check_overflow: bool, pub use_dll_storage_attrs: bool, @@ -59,11 +59,11 @@ pub struct CodegenCx<'ll, 'tcx: 'll, V = &'ll Value> { pub codegen_unit: Arc>, /// Cache instances of monomorphic and polymorphic items - pub instances: RefCell, V>>, + pub instances: RefCell, &'ll Value>>, /// Cache generated vtables - pub vtables: RefCell, ty::PolyExistentialTraitRef<'tcx>), V>>, + pub vtables: RefCell, ty::PolyExistentialTraitRef<'tcx>), &'ll Value>>, /// Cache of constant strings, - pub const_cstr_cache: RefCell>, + pub const_cstr_cache: RefCell>, /// Reverse-direction for const ptrs cast from globals. /// Key is a Value holding a *T, @@ -73,20 +73,20 @@ pub struct CodegenCx<'ll, 'tcx: 'll, V = &'ll Value> { /// when we ptrcast, and we have to ptrcast during codegen /// of a [T] const because we form a slice, a (*T,usize) pair, not /// a pointer to an LLVM array type. Similar for trait objects. - pub const_unsized: RefCell>, + pub const_unsized: RefCell>, /// Cache of emitted const globals (value -> global) - pub const_globals: RefCell>, + pub const_globals: RefCell>, /// List of globals for static variables which need to be passed to the /// LLVM function ReplaceAllUsesWith (RAUW) when codegen is complete. /// (We have to make sure we don't invalidate any Values referring /// to constants.) - pub statics_to_rauw: RefCell>, + pub statics_to_rauw: RefCell>, /// Statics that will be placed in the llvm.used variable /// See http://llvm.org/docs/LangRef.html#the-llvm-used-global-variable for details - pub used_statics: RefCell>, + pub used_statics: RefCell>, pub lltypes: RefCell, Option), &'ll Type>>, pub scalar_lltypes: RefCell, &'ll Type>>, @@ -95,11 +95,11 @@ pub struct CodegenCx<'ll, 'tcx: 'll, V = &'ll Value> { pub dbg_cx: Option>, - eh_personality: Cell>, - eh_unwind_resume: Cell>, - pub rust_try_fn: Cell>, + eh_personality: Cell>, + eh_unwind_resume: Cell>, + pub rust_try_fn: Cell>, - intrinsics: RefCell>, + intrinsics: RefCell>, /// A counter that is used for generating local symbol names local_gen_sym_counter: Cell, diff --git a/src/librustc_codegen_ssa/README.md b/src/librustc_codegen_ssa/README.md index b7bf0b099e935..9e1d429180367 100644 --- a/src/librustc_codegen_ssa/README.md +++ b/src/librustc_codegen_ssa/README.md @@ -29,12 +29,12 @@ While the LLVM-specific code will be left in `rustc_codegen_llvm`, all the new t The two most important structures for the LLVM codegen are `CodegenCx` and `Builder`. They are parametrized by multiple liftime parameters and the type for `Value`. ```rust -struct CodegenCx<'ll, 'tcx: 'll, V: 'll = &'ll Value> { +struct CodegenCx<'ll, 'tcx: 'll> { /* ... */ } -struct Builder<'a, 'll: 'a, 'tcx: 'll, V: 'll = &'ll Value> { - cx: &'a CodegenCx<'ll, 'tcx, V>, +struct Builder<'a, 'll: 'a, 'tcx: 'll> { + cx: &'a CodegenCx<'ll, 'tcx>, /* ... */ } ```