diff options
| author | Denis Merigoux <denis.merigoux@gmail.com> | 2018-08-29 16:40:47 +0200 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-11-16 14:11:59 +0200 |
| commit | 3aee77277efbac0b9b14b2097ea8a2c449fb1fc3 (patch) | |
| tree | 665945d226ace05cc576c73fbde486c37d249c2a /src/librustc_codegen_llvm/interfaces | |
| parent | 83e07f9fe9b7237fd48f79112686b886ae56a920 (diff) | |
| download | rust-3aee77277efbac0b9b14b2097ea8a2c449fb1fc3.tar.gz rust-3aee77277efbac0b9b14b2097ea8a2c449fb1fc3.zip | |
Split CommonMethods to accomodate for use in back/write.rs
Diffstat (limited to 'src/librustc_codegen_llvm/interfaces')
| -rw-r--r-- | src/librustc_codegen_llvm/interfaces/common.rs | 10 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/interfaces/mod.rs | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/librustc_codegen_llvm/interfaces/common.rs b/src/librustc_codegen_llvm/interfaces/common.rs index fe587bd8f83..f58338f384f 100644 --- a/src/librustc_codegen_llvm/interfaces/common.rs +++ b/src/librustc_codegen_llvm/interfaces/common.rs @@ -11,9 +11,7 @@ use super::Backend; use syntax::symbol::LocalInternedString; -pub trait CommonMethods : Backend { - fn val_ty(v: Self::Value) -> Self::Type; - +pub trait CommonMethods : Backend + CommonWriteMethods { // Constant constructors fn c_null(&self, t: Self::Type) -> Self::Value; fn c_undef(&self, t: Self::Type) -> Self::Value; @@ -50,7 +48,6 @@ pub trait CommonMethods : Backend { fn c_array(ty: Self::Type, elts: &[Self::Value]) -> Self::Value; fn c_vector(elts: &[Self::Value]) -> Self::Value; fn c_bytes(&self, bytes: &[u8]) -> Self::Value; - fn c_bytes_in_context(llcx: Self::Context, bytes: &[u8]) -> Self::Value; fn const_get_elt(v: Self::Value, idx: u64) -> Self::Value; fn const_get_real(v: Self::Value) -> Option<(f64, bool)>; @@ -59,3 +56,8 @@ pub trait CommonMethods : Backend { fn is_const_real(v: Self::Value) -> bool; fn const_to_opt_u128(v: Self::Value, sign_ext: bool) -> Option<u128>; } + +pub trait CommonWriteMethods : Backend { + fn val_ty(v: Self::Value) -> Self::Type; + fn c_bytes_in_context(llcx: Self::Context, bytes: &[u8]) -> Self::Value; +} diff --git a/src/librustc_codegen_llvm/interfaces/mod.rs b/src/librustc_codegen_llvm/interfaces/mod.rs index 77db6393f6c..e8ece54718e 100644 --- a/src/librustc_codegen_llvm/interfaces/mod.rs +++ b/src/librustc_codegen_llvm/interfaces/mod.rs @@ -14,4 +14,4 @@ mod common; pub use self::builder::BuilderMethods; pub use self::backend::Backend; -pub use self::common::CommonMethods; +pub use self::common::{CommonMethods, CommonWriteMethods}; |
