about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc_codegen_llvm/interfaces')
-rw-r--r--src/librustc_codegen_llvm/interfaces/common.rs10
-rw-r--r--src/librustc_codegen_llvm/interfaces/mod.rs2
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};