diff options
| author | Denis Merigoux <denis.merigoux@gmail.com> | 2018-08-21 16:31:36 +0200 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-11-16 14:11:09 +0200 |
| commit | bc86624c43a24ed569a08aaeae3bdea7be181bf7 (patch) | |
| tree | df48b7bc94d7f21d0b3769f25b6eea4352d55e9d /src/librustc_codegen_llvm | |
| parent | 8590336d491d5b228b3ae043e09a17dc950ae777 (diff) | |
| download | rust-bc86624c43a24ed569a08aaeae3bdea7be181bf7.tar.gz rust-bc86624c43a24ed569a08aaeae3bdea7be181bf7.zip | |
Removed useless traits for IntPredicate and RealPredicate
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/builder.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/llvm/ffi.rs | 8 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/traits.rs | 9 |
3 files changed, 5 insertions, 14 deletions
diff --git a/src/librustc_codegen_llvm/builder.rs b/src/librustc_codegen_llvm/builder.rs index 488b1a2ff4e..b63bd8f4e3d 100644 --- a/src/librustc_codegen_llvm/builder.rs +++ b/src/librustc_codegen_llvm/builder.rs @@ -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()) } diff --git a/src/librustc_codegen_llvm/llvm/ffi.rs b/src/librustc_codegen_llvm/llvm/ffi.rs index 37fa2e46b28..dd47024a657 100644 --- a/src/librustc_codegen_llvm/llvm/ffi.rs +++ b/src/librustc_codegen_llvm/llvm/ffi.rs @@ -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, diff --git a/src/librustc_codegen_llvm/traits.rs b/src/librustc_codegen_llvm/traits.rs index 0c53d0eaf90..a3a90952958 100644 --- a/src/librustc_codegen_llvm/traits.rs +++ b/src/librustc_codegen_llvm/traits.rs @@ -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 |
