提交 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 {
/* 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())
}
......
......@@ -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,
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册