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

Removed useless traits for IntPredicate and RealPredicate

上级 8590336d
...@@ -691,7 +691,7 @@ fn pointercast(&self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value { ...@@ -691,7 +691,7 @@ fn pointercast(&self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value {
/* 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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册