提交 89825f2e 编写于 作者: D Denis Merigoux 提交者: Eduard-Mihai Burtescu

Use associated types instead of type parameters inside the BuilderMethods trait

上级 9c41e1aa
......@@ -76,7 +76,6 @@
use rustc_data_structures::indexed_vec::Idx;
use traits::{IntPredicate, RealPredicate, BuilderMethods};
use llvm::BasicBlock;
use std::any::Any;
use std::cmp;
......@@ -390,9 +389,8 @@ pub fn call_assume(bx: &Builder<'_, 'll, '_>, val: &'ll Value) {
bx.call(assume_intrinsic, &[val], None);
}
pub fn from_immediate<'a, 'll: 'a, 'tcx: 'll,
Builder: BuilderMethods<'a, 'll, 'tcx, Value, BasicBlock>>(
bx: &Builder,
pub fn from_immediate<'a, 'll: 'a, 'tcx: 'll>(
bx: &Builder<'_ ,'ll, '_, &'ll Value>,
val: &'ll Value
) -> &'ll Value {
if val_ty(val) == Type::i1(bx.cx()) {
......@@ -424,9 +422,8 @@ pub fn to_immediate_scalar(
val
}
pub fn call_memcpy<'a, 'll: 'a, 'tcx: 'll,
Builder: BuilderMethods<'a, 'll, 'tcx, Value, BasicBlock>>(
bx: &Builder,
pub fn call_memcpy<'a, 'll: 'a, 'tcx: 'll>(
bx: &Builder<'_ ,'ll, '_, &'ll Value>,
dst: &'ll Value,
dst_align: Align,
src: &'ll Value,
......@@ -449,9 +446,8 @@ pub fn call_memcpy<'a, 'll: 'a, 'tcx: 'll,
bx.memcpy(dst_ptr, dst_align.abi(), src_ptr, src_align.abi(), size, volatile);
}
pub fn memcpy_ty<'a, 'll: 'a, 'tcx: 'll,
Builder: BuilderMethods<'a, 'll, 'tcx, Value, BasicBlock>>(
bx: &Builder,
pub fn memcpy_ty<'a, 'll: 'a, 'tcx: 'll>(
bx: &Builder<'_ ,'ll, '_, &'ll Value>,
dst: &'ll Value,
dst_align: Align,
src: &'ll Value,
......
......@@ -22,7 +22,6 @@
use glue;
use traits::BuilderMethods;
use llvm::BasicBlock;
use std::fmt;
......@@ -280,9 +279,7 @@ pub fn unaligned_volatile_store(
}
}
impl<'a, 'll: 'a, 'tcx: 'll> OperandValue<&'ll Value> where
Builder<'a, 'll, 'tcx>: BuilderMethods<'a, 'll, 'tcx, Value, BasicBlock>
{
impl<'a, 'll: 'a, 'tcx: 'll> OperandValue<&'ll Value> {
pub fn nontemporal_store(
self,
bx: &Builder<'a, 'll, 'tcx>,
......@@ -291,9 +288,9 @@ pub fn nontemporal_store(
self.store_with_flags(bx, dest, MemFlags::NONTEMPORAL);
}
fn store_with_flags<Builder: BuilderMethods<'a, 'll, 'tcx, Value, BasicBlock>>(
fn store_with_flags(
self,
bx: &Builder,
bx: &Builder<'a, 'll, 'tcx, &'ll Value>,
dest: PlaceRef<'tcx, &'ll Value>,
flags: MemFlags,
) {
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册