1
Fork 0

Removed genericity over Value in various functions

Prelude to using associated types in traits rather than type parameters
This commit is contained in:
Denis Merigoux 2018-08-22 17:48:32 +02:00 committed by Eduard-Mihai Burtescu
parent 1ca750683e
commit 9c41e1aa10
20 changed files with 165 additions and 194 deletions

View file

@ -16,7 +16,7 @@ use rustc::ty::layout::{self, Align, LayoutOf, TyLayout};
use base;
use common::{CodegenCx, C_undef, C_usize};
use builder::{Builder, MemFlags};
use value::{Value, ValueTrait};
use value::Value;
use type_of::LayoutLlvmExt;
use type_::Type;
use glue;
@ -63,7 +63,7 @@ pub struct OperandRef<'tcx, V> {
pub layout: TyLayout<'tcx>,
}
impl<Value: ?Sized> fmt::Debug for OperandRef<'tcx, &'ll Value> where Value: ValueTrait {
impl fmt::Debug for OperandRef<'tcx, &'ll Value> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "OperandRef({:?} @ {:?})", self.val, self.layout)
}
@ -265,7 +265,7 @@ impl OperandValue<&'ll Value> {
pub fn volatile_store(
self,
bx: &Builder<'a, 'll, 'tcx, &'ll Value>,
bx: &Builder<'a, 'll, 'tcx>,
dest: PlaceRef<'tcx, &'ll Value>
) {
self.store_with_flags(bx, dest, MemFlags::VOLATILE);
@ -280,14 +280,12 @@ impl OperandValue<&'ll Value> {
}
}
impl<'a, 'll: 'a, 'tcx: 'll, Value : ?Sized> OperandValue<&'ll Value> where
Value : ValueTrait,
Builder<'a, 'll, 'tcx, &'ll Value>:
BuilderMethods<'a, 'll, 'tcx, Value, BasicBlock>
impl<'a, 'll: 'a, 'tcx: 'll> OperandValue<&'ll Value> where
Builder<'a, 'll, 'tcx>: BuilderMethods<'a, 'll, 'tcx, Value, BasicBlock>
{
pub fn nontemporal_store(
self,
bx: &Builder<'a, 'll, 'tcx, &'ll Value>,
bx: &Builder<'a, 'll, 'tcx>,
dest: PlaceRef<'tcx, &'ll Value>
) {
self.store_with_flags(bx, dest, MemFlags::NONTEMPORAL);
@ -331,7 +329,7 @@ impl<'a, 'll: 'a, 'tcx: 'll, Value : ?Sized> OperandValue<&'ll Value> where
impl OperandValue<&'ll Value> {
pub fn store_unsized(
self,
bx: &Builder<'a, 'll, 'tcx, &'ll Value>,
bx: &Builder<'a, 'll, 'tcx>,
indirect_dest: PlaceRef<'tcx, &'ll Value>
) {
debug!("OperandRef::store_unsized: operand={:?}, indirect_dest={:?}", self, indirect_dest);