Removing LLVM content from CommonMethods -> ConstMethods

This commit is contained in:
Denis Merigoux 2018-09-06 14:44:51 -07:00 committed by Eduard-Mihai Burtescu
parent e224f063e8
commit a1d0d4f943
25 changed files with 55 additions and 124 deletions

View file

@ -68,9 +68,6 @@ extern crate tempfile;
extern crate memmap;
use back::bytecode::RLIB_BYTECODE_EXTENSION;
use interfaces::{Backend, CommonWriteMethods};
use value::Value;
use type_::Type;
pub use llvm_util::target_features;
use std::any::Any;
@ -326,14 +323,6 @@ struct ModuleLlvm<'ll> {
phantom: PhantomData<&'ll ()>
}
impl<'ll> Backend for ModuleLlvm<'ll> {
type Value = &'ll Value;
type BasicBlock = &'ll llvm::BasicBlock;
type Type = &'ll Type;
type TypeKind = llvm::TypeKind;
type Context = &'ll llvm::Context;
}
unsafe impl Send for ModuleLlvm<'ll> { }
unsafe impl Sync for ModuleLlvm<'ll> { }
@ -359,25 +348,6 @@ impl ModuleLlvm<'ll> {
}
}
impl CommonWriteMethods for ModuleLlvm<'ll> {
fn val_ty(&self, v: &'ll Value) -> &'ll Type {
common::val_ty(v)
}
fn const_bytes_in_context(&self, llcx: &'ll llvm::Context, bytes: &[u8]) -> &'ll Value {
common::const_bytes_in_context(llcx, bytes)
}
fn const_struct_in_context(
&self,
llcx: &'a llvm::Context,
elts: &[&'a Value],
packed: bool,
) -> &'a Value {
common::const_struct_in_context(llcx, elts, packed)
}
}
impl Drop for ModuleLlvm<'ll> {
fn drop(&mut self) {
unsafe {