about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2018-11-16 13:48:26 +0200
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2018-11-16 15:08:18 +0200
commit756f84d7cef90b7364ae88ca707e59670dde4c92 (patch)
tree80c9b92b7137bf37df90c30b4ee527a9e9cb3fbf /src
parent0b569249c8f15d651a0e80a031bdf0557a0fd84b (diff)
downloadrust-756f84d7cef90b7364ae88ca707e59670dde4c92.tar.gz
rust-756f84d7cef90b7364ae88ca707e59670dde4c92.zip
[eddyb] rustc_codegen_llvm: remove unused parametrization of `CodegenCx` and `Builder` over `Value`s.
Diffstat (limited to 'src')
-rw-r--r--src/librustc_codegen_llvm/base.rs6
-rw-r--r--src/librustc_codegen_llvm/builder.rs6
-rw-r--r--src/librustc_codegen_llvm/context.rs24
-rw-r--r--src/librustc_codegen_ssa/README.md6
4 files changed, 21 insertions, 21 deletions
diff --git a/src/librustc_codegen_llvm/base.rs b/src/librustc_codegen_llvm/base.rs
index a1ec133214a..78693a395b3 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::<Builder<&Value>>(&cx, linkage, visibility);
+                mono_item.predefine::<Builder>(&cx, linkage, visibility);
             }
 
             // ... and now that we have everything pre-defined, fill out those definitions.
             for &(mono_item, _) in &mono_items {
-                mono_item.define::<Builder<&Value>>(&cx);
+                mono_item.define::<Builder>(&cx);
             }
 
             // If this codegen unit contains the main function, also create the
             // wrapper here
-            maybe_create_entry_wrapper::<Builder<&Value>>(&cx);
+            maybe_create_entry_wrapper::<Builder>(&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 a71fe781f6a..34e4f4d7e18 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<V> 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 4a7ef9f8374..5b088ad2908 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<CodegenUnit<'tcx>>,
 
     /// Cache instances of monomorphic and polymorphic items
-    pub instances: RefCell<FxHashMap<Instance<'tcx>, V>>,
+    pub instances: RefCell<FxHashMap<Instance<'tcx>, &'ll Value>>,
     /// Cache generated vtables
-    pub vtables: RefCell<FxHashMap<(Ty<'tcx>, ty::PolyExistentialTraitRef<'tcx>), V>>,
+    pub vtables: RefCell<FxHashMap<(Ty<'tcx>, ty::PolyExistentialTraitRef<'tcx>), &'ll Value>>,
     /// Cache of constant strings,
-    pub const_cstr_cache: RefCell<FxHashMap<LocalInternedString, V>>,
+    pub const_cstr_cache: RefCell<FxHashMap<LocalInternedString, &'ll Value>>,
 
     /// 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<FxHashMap<V, V>>,
+    pub const_unsized: RefCell<FxHashMap<&'ll Value, &'ll Value>>,
 
     /// Cache of emitted const globals (value -> global)
-    pub const_globals: RefCell<FxHashMap<V, V>>,
+    pub const_globals: RefCell<FxHashMap<&'ll Value, &'ll Value>>,
 
     /// 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<Vec<(V, V)>>,
+    pub statics_to_rauw: RefCell<Vec<(&'ll Value, &'ll Value)>>,
 
     /// 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<Vec<V>>,
+    pub used_statics: RefCell<Vec<&'ll Value>>,
 
     pub lltypes: RefCell<FxHashMap<(Ty<'tcx>, Option<VariantIdx>), &'ll Type>>,
     pub scalar_lltypes: RefCell<FxHashMap<Ty<'tcx>, &'ll Type>>,
@@ -95,11 +95,11 @@ pub struct CodegenCx<'ll, 'tcx: 'll, V = &'ll Value> {
 
     pub dbg_cx: Option<debuginfo::CrateDebugContext<'ll, 'tcx>>,
 
-    eh_personality: Cell<Option<V>>,
-    eh_unwind_resume: Cell<Option<V>>,
-    pub rust_try_fn: Cell<Option<V>>,
+    eh_personality: Cell<Option<&'ll Value>>,
+    eh_unwind_resume: Cell<Option<&'ll Value>>,
+    pub rust_try_fn: Cell<Option<&'ll Value>>,
 
-    intrinsics: RefCell<FxHashMap<&'static str, V>>,
+    intrinsics: RefCell<FxHashMap<&'static str, &'ll Value>>,
 
     /// A counter that is used for generating local symbol names
     local_gen_sym_counter: Cell<usize>,
diff --git a/src/librustc_codegen_ssa/README.md b/src/librustc_codegen_ssa/README.md
index b7bf0b099e9..9e1d4291803 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>,
   /* ... */
 }
 ```