Skip to content

Commit bc86624

Browse files
denismerigouxeddyb
authored andcommitted
Removed useless traits for IntPredicate and RealPredicate
1 parent 8590336 commit bc86624

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

src/librustc_codegen_llvm/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ impl BuilderMethods<'a, 'll, 'tcx, Value, BasicBlock>
691691
/* Comparisons */
692692
fn icmp(&self, op: traits::IntPredicate, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
693693
self.count_insn("icmp");
694-
let op : llvm::IntPredicate = traits::IntPredicateMethods::convert_to_backend_specific(op);
694+
let op = llvm::IntPredicate::from_generic(op);
695695
unsafe {
696696
llvm::LLVMBuildICmp(self.llbuilder, op as c_uint, lhs, rhs, noname())
697697
}

src/librustc_codegen_llvm/llvm/ffi.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ pub enum IntPredicate {
142142
IntSLE = 41,
143143
}
144144

145-
impl traits::IntPredicateMethods for IntPredicate {
146-
fn convert_to_backend_specific(intpre: traits::IntPredicate) -> Self {
145+
impl IntPredicate {
146+
pub fn from_generic(intpre: traits::IntPredicate) -> Self {
147147
match intpre {
148148
traits::IntPredicate::IntEQ => IntPredicate::IntEQ,
149149
traits::IntPredicate::IntNE => IntPredicate::IntNE,
@@ -181,8 +181,8 @@ pub enum RealPredicate {
181181
RealPredicateTrue = 15,
182182
}
183183

184-
impl traits::RealPredicateMethods for RealPredicate {
185-
fn convert_to_backend_specific(realpred: traits::RealPredicate) -> Self {
184+
impl RealPredicate {
185+
pub fn from_generic(realpred: traits::RealPredicate) -> Self {
186186
match realpred {
187187
traits::RealPredicate::RealPredicateFalse => RealPredicate::RealPredicateFalse,
188188
traits::RealPredicate::RealOEQ => RealPredicate::RealOEQ,

src/librustc_codegen_llvm/traits.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ pub enum IntPredicate {
3434
IntSLE,
3535
}
3636

37-
pub trait IntPredicateMethods {
38-
fn convert_to_backend_specific(intpre : IntPredicate) -> Self;
39-
}
40-
4137
#[allow(dead_code)]
4238
pub enum RealPredicate {
4339
RealPredicateFalse,
@@ -58,11 +54,6 @@ pub enum RealPredicate {
5854
RealPredicateTrue,
5955
}
6056

61-
pub trait RealPredicateMethods {
62-
fn convert_to_backend_specific(realpred : RealPredicate) -> Self;
63-
}
64-
65-
6657
pub trait BuilderMethods<'a, 'll :'a, 'tcx: 'll,
6758
Value : ?Sized,
6859
BasicBlock: ?Sized

0 commit comments

Comments
 (0)