1
Fork 0

Removed useless traits for IntPredicate and RealPredicate

This commit is contained in:
Denis Merigoux 2018-08-21 16:31:36 +02:00 committed by Eduard-Mihai Burtescu
parent 8590336d49
commit bc86624c43
3 changed files with 5 additions and 14 deletions

View file

@ -691,7 +691,7 @@ impl BuilderMethods<'a, 'll, 'tcx, Value, BasicBlock>
/* Comparisons */
fn icmp(&self, op: traits::IntPredicate, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
self.count_insn("icmp");
let op : llvm::IntPredicate = traits::IntPredicateMethods::convert_to_backend_specific(op);
let op = llvm::IntPredicate::from_generic(op);
unsafe {
llvm::LLVMBuildICmp(self.llbuilder, op as c_uint, lhs, rhs, noname())
}

View file

@ -142,8 +142,8 @@ pub enum IntPredicate {
IntSLE = 41,
}
impl traits::IntPredicateMethods for IntPredicate {
fn convert_to_backend_specific(intpre: traits::IntPredicate) -> Self {
impl IntPredicate {
pub fn from_generic(intpre: traits::IntPredicate) -> Self {
match intpre {
traits::IntPredicate::IntEQ => IntPredicate::IntEQ,
traits::IntPredicate::IntNE => IntPredicate::IntNE,
@ -181,8 +181,8 @@ pub enum RealPredicate {
RealPredicateTrue = 15,
}
impl traits::RealPredicateMethods for RealPredicate {
fn convert_to_backend_specific(realpred: traits::RealPredicate) -> Self {
impl RealPredicate {
pub fn from_generic(realpred: traits::RealPredicate) -> Self {
match realpred {
traits::RealPredicate::RealPredicateFalse => RealPredicate::RealPredicateFalse,
traits::RealPredicate::RealOEQ => RealPredicate::RealOEQ,

View file

@ -34,10 +34,6 @@ pub enum IntPredicate {
IntSLE,
}
pub trait IntPredicateMethods {
fn convert_to_backend_specific(intpre : IntPredicate) -> Self;
}
#[allow(dead_code)]
pub enum RealPredicate {
RealPredicateFalse,
@ -58,11 +54,6 @@ pub enum RealPredicate {
RealPredicateTrue,
}
pub trait RealPredicateMethods {
fn convert_to_backend_specific(realpred : RealPredicate) -> Self;
}
pub trait BuilderMethods<'a, 'll :'a, 'tcx: 'll,
Value : ?Sized,
BasicBlock: ?Sized