]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_codegen_llvm/mir/rvalue.rs
Generalized base.rs#call_memcpy and everything that it uses
[rust.git] / src / librustc_codegen_llvm / mir / rvalue.rs
index af166fe501e7f38dafc55135090cbc57227212fa..017b13410cd53c36b279449b4417f90af9752a90 100644 (file)
@@ -28,6 +28,8 @@
 use type_of::LayoutLlvmExt;
 use value::Value;
 
+use traits::BuilderMethods;
+
 use super::{FunctionCx, LocalRef};
 use super::operand::{OperandRef, OperandValue};
 use super::place::PlaceRef;
@@ -178,12 +180,12 @@ pub fn codegen_rvalue(&mut self,
         }
     }
 
-    pub fn codegen_rvalue_unsized(
-        &mut self,
-        bx: Builder<'a, 'll, 'tcx>,
-        indirect_dest: PlaceRef<'tcx, &'ll Value>,
-        rvalue: &mir::Rvalue<'tcx>,
-    ) -> Builder<'a, 'll, 'tcx> {
+    pub fn codegen_rvalue_unsized(&mut self,
+                        bx: Builder<'a, 'll, 'tcx, &'ll Value>,
+                        indirect_dest: PlaceRef<'tcx, &'ll Value>,
+                        rvalue: &mir::Rvalue<'tcx>)
+                        -> Builder<'a, 'll, 'tcx, &'ll Value>
+    {
         debug!("codegen_rvalue_unsized(indirect_dest.llval={:?}, rvalue={:?})",
                indirect_dest.llval, rvalue);
 
@@ -198,11 +200,11 @@ pub fn codegen_rvalue_unsized(
         }
     }
 
-    pub fn codegen_rvalue_operand(&mut self,
-                                bx: Builder<'a, 'll, 'tcx>,
-                                rvalue: &mir::Rvalue<'tcx>)
-                                -> (Builder<'a, 'll, 'tcx>, OperandRef<'tcx, &'ll Value>)
-    {
+    pub fn codegen_rvalue_operand(
+        &mut self,
+        bx: Builder<'a, 'll, 'tcx, &'ll Value>,
+        rvalue: &mir::Rvalue<'tcx>
+    ) -> (Builder<'a, 'll, 'tcx, &'ll Value>, OperandRef<'tcx, &'ll Value>) {
         assert!(self.rvalue_creates_operand(rvalue), "cannot codegen {:?} to operand", rvalue);
 
         match *rvalue {
@@ -750,7 +752,11 @@ enum OverflowOp {
     Add, Sub, Mul
 }
 
-fn get_overflow_intrinsic(oop: OverflowOp, bx: &Builder<'_, 'll, '_>, ty: Ty) -> &'ll Value {
+fn get_overflow_intrinsic(
+    oop: OverflowOp,
+    bx: &Builder<'_, 'll, '_, &'ll Value>,
+    ty: Ty
+) -> &'ll Value {
     use syntax::ast::IntTy::*;
     use syntax::ast::UintTy::*;
     use rustc::ty::{Int, Uint};