Removed useless traits for IntPredicate and RealPredicate
This commit is contained in:
parent
8590336d49
commit
bc86624c43
3 changed files with 5 additions and 14 deletions
|
@ -691,7 +691,7 @@ impl BuilderMethods<'a, 'll, 'tcx, Value, BasicBlock>
|
||||||
/* Comparisons */
|
/* Comparisons */
|
||||||
fn icmp(&self, op: traits::IntPredicate, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
fn icmp(&self, op: traits::IntPredicate, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
||||||
self.count_insn("icmp");
|
self.count_insn("icmp");
|
||||||
let op : llvm::IntPredicate = traits::IntPredicateMethods::convert_to_backend_specific(op);
|
let op = llvm::IntPredicate::from_generic(op);
|
||||||
unsafe {
|
unsafe {
|
||||||
llvm::LLVMBuildICmp(self.llbuilder, op as c_uint, lhs, rhs, noname())
|
llvm::LLVMBuildICmp(self.llbuilder, op as c_uint, lhs, rhs, noname())
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,8 +142,8 @@ pub enum IntPredicate {
|
||||||
IntSLE = 41,
|
IntSLE = 41,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl traits::IntPredicateMethods for IntPredicate {
|
impl IntPredicate {
|
||||||
fn convert_to_backend_specific(intpre: traits::IntPredicate) -> Self {
|
pub fn from_generic(intpre: traits::IntPredicate) -> Self {
|
||||||
match intpre {
|
match intpre {
|
||||||
traits::IntPredicate::IntEQ => IntPredicate::IntEQ,
|
traits::IntPredicate::IntEQ => IntPredicate::IntEQ,
|
||||||
traits::IntPredicate::IntNE => IntPredicate::IntNE,
|
traits::IntPredicate::IntNE => IntPredicate::IntNE,
|
||||||
|
@ -181,8 +181,8 @@ pub enum RealPredicate {
|
||||||
RealPredicateTrue = 15,
|
RealPredicateTrue = 15,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl traits::RealPredicateMethods for RealPredicate {
|
impl RealPredicate {
|
||||||
fn convert_to_backend_specific(realpred: traits::RealPredicate) -> Self {
|
pub fn from_generic(realpred: traits::RealPredicate) -> Self {
|
||||||
match realpred {
|
match realpred {
|
||||||
traits::RealPredicate::RealPredicateFalse => RealPredicate::RealPredicateFalse,
|
traits::RealPredicate::RealPredicateFalse => RealPredicate::RealPredicateFalse,
|
||||||
traits::RealPredicate::RealOEQ => RealPredicate::RealOEQ,
|
traits::RealPredicate::RealOEQ => RealPredicate::RealOEQ,
|
||||||
|
|
|
@ -34,10 +34,6 @@ pub enum IntPredicate {
|
||||||
IntSLE,
|
IntSLE,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait IntPredicateMethods {
|
|
||||||
fn convert_to_backend_specific(intpre : IntPredicate) -> Self;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub enum RealPredicate {
|
pub enum RealPredicate {
|
||||||
RealPredicateFalse,
|
RealPredicateFalse,
|
||||||
|
@ -58,11 +54,6 @@ pub enum RealPredicate {
|
||||||
RealPredicateTrue,
|
RealPredicateTrue,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait RealPredicateMethods {
|
|
||||||
fn convert_to_backend_specific(realpred : RealPredicate) -> Self;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
pub trait BuilderMethods<'a, 'll :'a, 'tcx: 'll,
|
pub trait BuilderMethods<'a, 'll :'a, 'tcx: 'll,
|
||||||
Value : ?Sized,
|
Value : ?Sized,
|
||||||
BasicBlock: ?Sized
|
BasicBlock: ?Sized
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue