1
Fork 0

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

@ -18,7 +18,7 @@ use type_::Type;
use type_of::{LayoutLlvmExt, PointerKind}; use type_of::{LayoutLlvmExt, PointerKind};
use value::Value; use value::Value;
use interfaces::{BuilderMethods, CommonMethods, TypeMethods}; use interfaces::{BuilderMethods, ConstMethods, TypeMethods};
use rustc_target::abi::{HasDataLayout, LayoutOf, Size, TyLayout, Abi as LayoutAbi}; use rustc_target::abi::{HasDataLayout, LayoutOf, Size, TyLayout, Abi as LayoutAbi};
use rustc::ty::{self, Ty}; use rustc::ty::{self, Ty};

View file

@ -15,7 +15,7 @@ use builder::Builder;
use value::Value; use value::Value;
use rustc::hir; use rustc::hir;
use interfaces::{BuilderMethods, CommonMethods, TypeMethods}; use interfaces::{BuilderMethods, ConstMethods, TypeMethods};
use mir::place::PlaceRef; use mir::place::PlaceRef;
use mir::operand::OperandValue; use mir::operand::OperandValue;

View file

@ -49,7 +49,6 @@ use context::{is_pie_binary, get_reloc_model};
use common; use common;
use jobserver::{Client, Acquired}; use jobserver::{Client, Acquired};
use rustc_demangle; use rustc_demangle;
use value::Value;
use std::marker::PhantomData; use std::marker::PhantomData;
use std::any::Any; use std::any::Any;
@ -428,24 +427,6 @@ impl CodegenContext<'ll> {
} }
} }
impl CodegenContext<'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)
}
pub fn type_ptr_to(&self, ty: &'ll Type) -> &'ll Type {
unsafe {
llvm::LLVMPointerType(ty, 0)
}
}
}
pub struct DiagnosticHandlers<'a> { pub struct DiagnosticHandlers<'a> {
data: *mut (&'a CodegenContext<'a>, &'a Handler), data: *mut (&'a CodegenContext<'a>, &'a Handler),
llcx: &'a llvm::Context, llcx: &'a llvm::Context,
@ -907,10 +888,10 @@ unsafe fn embed_bitcode(cgcx: &CodegenContext,
llcx: &llvm::Context, llcx: &llvm::Context,
llmod: &llvm::Module, llmod: &llvm::Module,
bitcode: Option<&[u8]>) { bitcode: Option<&[u8]>) {
let llconst = cgcx.const_bytes_in_context(llcx, bitcode.unwrap_or(&[])); let llconst = common::bytes_in_context(llcx, bitcode.unwrap_or(&[]));
let llglobal = llvm::LLVMAddGlobal( let llglobal = llvm::LLVMAddGlobal(
llmod, llmod,
cgcx.val_ty(llconst), common::val_ty(llconst),
"rustc.embedded.module\0".as_ptr() as *const _, "rustc.embedded.module\0".as_ptr() as *const _,
); );
llvm::LLVMSetInitializer(llglobal, llconst); llvm::LLVMSetInitializer(llglobal, llconst);
@ -927,10 +908,10 @@ unsafe fn embed_bitcode(cgcx: &CodegenContext,
llvm::LLVMRustSetLinkage(llglobal, llvm::Linkage::PrivateLinkage); llvm::LLVMRustSetLinkage(llglobal, llvm::Linkage::PrivateLinkage);
llvm::LLVMSetGlobalConstant(llglobal, llvm::True); llvm::LLVMSetGlobalConstant(llglobal, llvm::True);
let llconst = cgcx.const_bytes_in_context(llcx, &[]); let llconst = common::bytes_in_context(llcx, &[]);
let llglobal = llvm::LLVMAddGlobal( let llglobal = llvm::LLVMAddGlobal(
llmod, llmod,
cgcx.val_ty(llconst), common::val_ty(llconst),
"rustc.embedded.cmdline\0".as_ptr() as *const _, "rustc.embedded.cmdline\0".as_ptr() as *const _,
); );
llvm::LLVMSetInitializer(llglobal, llconst); llvm::LLVMSetInitializer(llglobal, llconst);
@ -2598,7 +2579,7 @@ fn create_msvc_imps(cgcx: &CodegenContext, llcx: &llvm::Context, llmod: &llvm::M
"\x01__imp_" "\x01__imp_"
}; };
unsafe { unsafe {
let i8p_ty = Type::i8p_llcx(cgcx, llcx); let i8p_ty = Type::i8p_llcx(llcx);
let globals = base::iter_globals(llmod) let globals = base::iter_globals(llmod)
.filter(|&val| { .filter(|&val| {
llvm::LLVMRustGetLinkage(val) == llvm::Linkage::ExternalLinkage && llvm::LLVMRustGetLinkage(val) == llvm::Linkage::ExternalLinkage &&

View file

@ -54,7 +54,7 @@ use attributes;
use builder::{Builder, MemFlags}; use builder::{Builder, MemFlags};
use callee; use callee;
use rustc_mir::monomorphize::item::DefPathBasedNames; use rustc_mir::monomorphize::item::DefPathBasedNames;
use common::{IntPredicate, RealPredicate}; use common::{self, IntPredicate, RealPredicate};
use consts; use consts;
use context::CodegenCx; use context::CodegenCx;
use debuginfo; use debuginfo;
@ -74,7 +74,7 @@ use rustc_data_structures::small_c_str::SmallCStr;
use rustc_data_structures::sync::Lrc; use rustc_data_structures::sync::Lrc;
use rustc_data_structures::indexed_vec::Idx; use rustc_data_structures::indexed_vec::Idx;
use interfaces::{BuilderMethods, CommonMethods, CommonWriteMethods, TypeMethods}; use interfaces::{BuilderMethods, ConstMethods, TypeMethods};
use std::any::Any; use std::any::Any;
use std::cmp; use std::cmp;
@ -649,12 +649,12 @@ fn write_metadata<'a, 'gcx>(tcx: TyCtxt<'a, 'gcx, 'gcx>,
DeflateEncoder::new(&mut compressed, Compression::fast()) DeflateEncoder::new(&mut compressed, Compression::fast())
.write_all(&metadata.raw_data).unwrap(); .write_all(&metadata.raw_data).unwrap();
let llmeta = llvm_module.const_bytes_in_context(metadata_llcx, &compressed); let llmeta = common::bytes_in_context(metadata_llcx, &compressed);
let llconst = llvm_module.const_struct_in_context(metadata_llcx, &[llmeta], false); let llconst = common::struct_in_context(metadata_llcx, &[llmeta], false);
let name = exported_symbols::metadata_symbol_name(tcx); let name = exported_symbols::metadata_symbol_name(tcx);
let buf = CString::new(name).unwrap(); let buf = CString::new(name).unwrap();
let llglobal = unsafe { let llglobal = unsafe {
llvm::LLVMAddGlobal(metadata_llmod, llvm_module.val_ty(llconst), buf.as_ptr()) llvm::LLVMAddGlobal(metadata_llmod, common::val_ty(llconst), buf.as_ptr())
}; };
unsafe { unsafe {
llvm::LLVMSetInitializer(llglobal, llconst); llvm::LLVMSetInitializer(llglobal, llconst);

View file

@ -19,7 +19,7 @@ use rustc::ty::TyCtxt;
use rustc::ty::layout::{Align, Size}; use rustc::ty::layout::{Align, Size};
use rustc::session::{config, Session}; use rustc::session::{config, Session};
use rustc_data_structures::small_c_str::SmallCStr; use rustc_data_structures::small_c_str::SmallCStr;
use interfaces::{BuilderMethods, Backend, CommonMethods, CommonWriteMethods, TypeMethods}; use interfaces::{BuilderMethods, Backend, ConstMethods, TypeMethods};
use syntax; use syntax;
use std::borrow::Cow; use std::borrow::Cow;

View file

@ -22,7 +22,7 @@ use llvm;
use monomorphize::Instance; use monomorphize::Instance;
use type_of::LayoutLlvmExt; use type_of::LayoutLlvmExt;
use value::Value; use value::Value;
use interfaces::CommonWriteMethods; use interfaces::TypeMethods;
use rustc::hir::def_id::DefId; use rustc::hir::def_id::DefId;
use rustc::ty::{self, TypeFoldable}; use rustc::ty::{self, TypeFoldable};

View file

@ -24,7 +24,7 @@ use declare;
use type_::Type; use type_::Type;
use type_of::LayoutLlvmExt; use type_of::LayoutLlvmExt;
use value::Value; use value::Value;
use interfaces::{Backend, CommonMethods, CommonWriteMethods, TypeMethods}; use interfaces::{Backend, ConstMethods, TypeMethods};
use rustc::ty::{self, Ty, TyCtxt}; use rustc::ty::{self, Ty, TyCtxt};
use rustc::ty::layout::{HasDataLayout, LayoutOf}; use rustc::ty::layout::{HasDataLayout, LayoutOf};
@ -201,7 +201,7 @@ impl Backend for CodegenCx<'ll, 'tcx> {
type Context = &'ll llvm::Context; type Context = &'ll llvm::Context;
} }
impl<'ll, 'tcx: 'll> CommonMethods for CodegenCx<'ll, 'tcx> { impl<'ll, 'tcx: 'll> ConstMethods for CodegenCx<'ll, 'tcx> {
// LLVM constant constructors. // LLVM constant constructors.
fn const_null(&self, t: &'ll Type) -> &'ll Value { fn const_null(&self, t: &'ll Type) -> &'ll Value {
@ -319,7 +319,7 @@ impl<'ll, 'tcx: 'll> CommonMethods for CodegenCx<'ll, 'tcx> {
elts: &[&'ll Value], elts: &[&'ll Value],
packed: bool packed: bool
) -> &'ll Value { ) -> &'ll Value {
&self.const_struct_in_context(&self.llcx, elts, packed) struct_in_context(&self.llcx, elts, packed)
} }
fn const_array(&self, ty: &'ll Type, elts: &[&'ll Value]) -> &'ll Value { fn const_array(&self, ty: &'ll Type, elts: &[&'ll Value]) -> &'ll Value {
@ -335,7 +335,7 @@ impl<'ll, 'tcx: 'll> CommonMethods for CodegenCx<'ll, 'tcx> {
} }
fn const_bytes(&self, bytes: &[u8]) -> &'ll Value { fn const_bytes(&self, bytes: &[u8]) -> &'ll Value {
&self.const_bytes_in_context(&self.llcx, bytes) bytes_in_context(&self.llcx, bytes)
} }
fn const_get_elt(&self, v: &'ll Value, idx: u64) -> &'ll Value { fn const_get_elt(&self, v: &'ll Value, idx: u64) -> &'ll Value {
@ -406,14 +406,14 @@ pub fn val_ty(v: &'ll Value) -> &'ll Type {
} }
} }
pub fn const_bytes_in_context(llcx: &'ll llvm::Context, bytes: &[u8]) -> &'ll Value { pub fn bytes_in_context(llcx: &'ll llvm::Context, bytes: &[u8]) -> &'ll Value {
unsafe { unsafe {
let ptr = bytes.as_ptr() as *const c_char; let ptr = bytes.as_ptr() as *const c_char;
return llvm::LLVMConstStringInContext(llcx, ptr, bytes.len() as c_uint, True); return llvm::LLVMConstStringInContext(llcx, ptr, bytes.len() as c_uint, True);
} }
} }
pub fn const_struct_in_context( pub fn struct_in_context(
llcx: &'a llvm::Context, llcx: &'a llvm::Context,
elts: &[&'a Value], elts: &[&'a Value],
packed: bool, packed: bool,
@ -425,26 +425,6 @@ pub fn const_struct_in_context(
} }
} }
impl<'ll, 'tcx: 'll> CommonWriteMethods for CodegenCx<'ll, 'tcx> {
fn val_ty(&self, v: &'ll Value) -> &'ll Type {
val_ty(v)
}
fn const_bytes_in_context(&self, llcx: &'ll llvm::Context, bytes: &[u8]) -> &'ll Value {
const_bytes_in_context(llcx, bytes)
}
fn const_struct_in_context(
&self,
llcx: &'a llvm::Context,
elts: &[&'a Value],
packed: bool,
) -> &'a Value {
const_struct_in_context(llcx, elts, packed)
}
}
#[inline] #[inline]
fn hi_lo_to_u128(lo: u64, hi: u64) -> u128 { fn hi_lo_to_u128(lo: u64, hi: u64) -> u128 {
((hi as u128) << 64) | (lo as u128) ((hi as u128) << 64) | (lo as u128)

View file

@ -24,7 +24,7 @@ use type_::Type;
use type_of::LayoutLlvmExt; use type_of::LayoutLlvmExt;
use value::Value; use value::Value;
use rustc::ty::{self, Ty}; use rustc::ty::{self, Ty};
use interfaces::{CommonWriteMethods, TypeMethods}; use interfaces::TypeMethods;
use rustc::ty::layout::{Align, LayoutOf}; use rustc::ty::layout::{Align, LayoutOf};

View file

@ -17,7 +17,7 @@ use builder::Builder;
use declare; use declare;
use rustc::session::config::DebugInfo; use rustc::session::config::DebugInfo;
use value::Value; use value::Value;
use interfaces::{BuilderMethods, CommonMethods, TypeMethods}; use interfaces::{BuilderMethods, ConstMethods, TypeMethods};
use syntax::attr; use syntax::attr;

View file

@ -18,7 +18,7 @@ use super::namespace::mangled_name_of_instance;
use super::type_names::compute_debuginfo_type_name; use super::type_names::compute_debuginfo_type_name;
use super::{CrateDebugContext}; use super::{CrateDebugContext};
use abi; use abi;
use interfaces::CommonMethods; use interfaces::ConstMethods;
use value::Value; use value::Value;
use llvm; use llvm;

View file

@ -20,7 +20,7 @@ use meth;
use rustc::ty::layout::LayoutOf; use rustc::ty::layout::LayoutOf;
use rustc::ty::{self, Ty}; use rustc::ty::{self, Ty};
use value::Value; use value::Value;
use interfaces::{BuilderMethods, CommonMethods}; use interfaces::{BuilderMethods, ConstMethods};
pub fn size_and_align_of_dst( pub fn size_and_align_of_dst(
bx: &Builder<'_, 'll, 'tcx>, bx: &Builder<'_, 'll, 'tcx>,

View file

@ -11,7 +11,7 @@
use super::Backend; use super::Backend;
use syntax::symbol::LocalInternedString; use syntax::symbol::LocalInternedString;
pub trait CommonMethods: Backend + CommonWriteMethods { pub trait ConstMethods: Backend {
// Constant constructors // Constant constructors
fn const_null(&self, t: Self::Type) -> Self::Value; fn const_null(&self, t: Self::Type) -> Self::Value;
fn const_undef(&self, t: Self::Type) -> Self::Value; fn const_undef(&self, t: Self::Type) -> Self::Value;
@ -52,14 +52,3 @@ pub trait CommonMethods: Backend + CommonWriteMethods {
fn is_const_integral(&self, v: Self::Value) -> bool; fn is_const_integral(&self, v: Self::Value) -> bool;
fn is_const_real(&self, v: Self::Value) -> bool; fn is_const_real(&self, v: Self::Value) -> bool;
} }
pub trait CommonWriteMethods: Backend {
fn val_ty(&self, v: Self::Value) -> Self::Type;
fn const_bytes_in_context(&self, llcx: Self::Context, bytes: &[u8]) -> Self::Value;
fn const_struct_in_context(
&self,
llcx: Self::Context,
elts: &[Self::Value],
packed: bool,
) -> Self::Value;
}

View file

@ -10,10 +10,10 @@
mod builder; mod builder;
mod backend; mod backend;
mod common; mod consts;
mod type_; mod type_;
pub use self::builder::BuilderMethods; pub use self::builder::BuilderMethods;
pub use self::backend::Backend; pub use self::backend::Backend;
pub use self::common::{CommonMethods, CommonWriteMethods}; pub use self::consts::ConstMethods;
pub use self::type_::TypeMethods; pub use self::type_::TypeMethods;

View file

@ -38,4 +38,6 @@ pub trait TypeMethods : Backend {
fn func_params_types(&self, ty: Self::Type) -> Vec<Self::Type>; fn func_params_types(&self, ty: Self::Type) -> Vec<Self::Type>;
fn float_width(&self, ty: Self::Type) -> usize; fn float_width(&self, ty: Self::Type) -> usize;
fn int_width(&self, ty: Self::Type) -> u64; fn int_width(&self, ty: Self::Type) -> u64;
fn val_ty(&self, v: Self::Value) -> Self::Type;
} }

View file

@ -32,7 +32,7 @@ use syntax::symbol::Symbol;
use builder::Builder; use builder::Builder;
use value::Value; use value::Value;
use interfaces::{BuilderMethods, CommonMethods, TypeMethods}; use interfaces::{BuilderMethods, ConstMethods, TypeMethods};
use rustc::session::Session; use rustc::session::Session;
use syntax_pos::Span; use syntax_pos::Span;

View file

@ -68,9 +68,6 @@ extern crate tempfile;
extern crate memmap; extern crate memmap;
use back::bytecode::RLIB_BYTECODE_EXTENSION; use back::bytecode::RLIB_BYTECODE_EXTENSION;
use interfaces::{Backend, CommonWriteMethods};
use value::Value;
use type_::Type;
pub use llvm_util::target_features; pub use llvm_util::target_features;
use std::any::Any; use std::any::Any;
@ -326,14 +323,6 @@ struct ModuleLlvm<'ll> {
phantom: PhantomData<&'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 Send for ModuleLlvm<'ll> { }
unsafe impl Sync 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> { impl Drop for ModuleLlvm<'ll> {
fn drop(&mut self) { fn drop(&mut self) {
unsafe { unsafe {

View file

@ -16,7 +16,7 @@ use consts;
use monomorphize; use monomorphize;
use value::Value; use value::Value;
use interfaces::{BuilderMethods, CommonMethods, TypeMethods}; use interfaces::{BuilderMethods, ConstMethods, TypeMethods};
use rustc::ty::{self, Ty}; use rustc::ty::{self, Ty};
use rustc::ty::layout::HasDataLayout; use rustc::ty::layout::HasDataLayout;

View file

@ -26,7 +26,7 @@ use type_of::LayoutLlvmExt;
use type_::Type; use type_::Type;
use value::Value; use value::Value;
use interfaces::{BuilderMethods, CommonMethods, TypeMethods}; use interfaces::{BuilderMethods, ConstMethods, TypeMethods};
use syntax::symbol::Symbol; use syntax::symbol::Symbol;
use syntax_pos::Pos; use syntax_pos::Pos;

View file

@ -25,7 +25,7 @@ use type_::Type;
use syntax::ast::Mutability; use syntax::ast::Mutability;
use syntax::source_map::Span; use syntax::source_map::Span;
use value::Value; use value::Value;
use interfaces::{BuilderMethods, CommonMethods, TypeMethods}; use interfaces::{BuilderMethods, ConstMethods, TypeMethods};
use super::super::callee; use super::super::callee;
use super::FunctionCx; use super::FunctionCx;

View file

@ -24,7 +24,7 @@ use debuginfo::{self, declare_local, VariableAccess, VariableKind, FunctionDebug
use monomorphize::Instance; use monomorphize::Instance;
use abi::{ArgTypeExt, FnType, FnTypeExt, PassMode}; use abi::{ArgTypeExt, FnType, FnTypeExt, PassMode};
use value::Value; use value::Value;
use interfaces::{BuilderMethods, CommonMethods}; use interfaces::{BuilderMethods, ConstMethods};
use syntax_pos::{DUMMY_SP, NO_EXPANSION, BytePos, Span}; use syntax_pos::{DUMMY_SP, NO_EXPANSION, BytePos, Span};
use syntax::symbol::keywords; use syntax::symbol::keywords;

View file

@ -20,7 +20,7 @@ use value::Value;
use type_of::LayoutLlvmExt; use type_of::LayoutLlvmExt;
use glue; use glue;
use interfaces::{BuilderMethods, CommonMethods, TypeMethods}; use interfaces::{BuilderMethods, ConstMethods, TypeMethods};
use std::fmt; use std::fmt;

View file

@ -22,7 +22,7 @@ use value::Value;
use glue; use glue;
use mir::constant::const_alloc_to_llvm; use mir::constant::const_alloc_to_llvm;
use interfaces::{BuilderMethods, CommonMethods, TypeMethods}; use interfaces::{BuilderMethods, ConstMethods, TypeMethods};
use super::{FunctionCx, LocalRef}; use super::{FunctionCx, LocalRef};
use super::operand::{OperandRef, OperandValue}; use super::operand::{OperandRef, OperandValue};

View file

@ -26,7 +26,7 @@ use type_::Type;
use type_of::LayoutLlvmExt; use type_of::LayoutLlvmExt;
use value::Value; use value::Value;
use interfaces::{BuilderMethods, CommonMethods, CommonWriteMethods, TypeMethods}; use interfaces::{BuilderMethods, ConstMethods, TypeMethods};
use super::{FunctionCx, LocalRef}; use super::{FunctionCx, LocalRef};
use super::operand::{OperandRef, OperandValue}; use super::operand::{OperandRef, OperandValue};

View file

@ -17,11 +17,12 @@ use llvm::{Bool, False, True, TypeKind};
use context::CodegenCx; use context::CodegenCx;
use interfaces::TypeMethods; use interfaces::TypeMethods;
use value::Value;
use syntax::ast; use syntax::ast;
use rustc::ty::layout::{self, Align, Size}; use rustc::ty::layout::{self, Align, Size};
use rustc_data_structures::small_c_str::SmallCStr; use rustc_data_structures::small_c_str::SmallCStr;
use back::write; use common;
use std::fmt; use std::fmt;
@ -188,9 +189,7 @@ impl TypeMethods for CodegenCx<'ll, 'tcx> {
fn type_ptr_to(&self, ty: &'ll Type) -> &'ll Type { fn type_ptr_to(&self, ty: &'ll Type) -> &'ll Type {
assert_ne!(self.type_kind(ty), TypeKind::Function, assert_ne!(self.type_kind(ty), TypeKind::Function,
"don't call ptr_to on function types, use ptr_to_llvm_type on FnType instead"); "don't call ptr_to on function types, use ptr_to_llvm_type on FnType instead");
unsafe { ty.ptr_to()
llvm::LLVMPointerType(ty, 0)
}
} }
fn element_type(&self, ty: &'ll Type) -> &'ll Type { fn element_type(&self, ty: &'ll Type) -> &'ll Type {
@ -232,6 +231,10 @@ impl TypeMethods for CodegenCx<'ll, 'tcx> {
llvm::LLVMGetIntTypeWidth(ty) as u64 llvm::LLVMGetIntTypeWidth(ty) as u64
} }
} }
fn val_ty(&self, v: &'ll Value) -> &'ll Type {
common::val_ty(v)
}
} }
impl Type { impl Type {
@ -251,8 +254,14 @@ impl Type {
} }
} }
pub fn i8p_llcx(cx : &write::CodegenContext<'ll>, llcx: &'ll llvm::Context) -> &'ll Type { pub fn i8p_llcx(llcx: &'ll llvm::Context) -> &'ll Type {
cx.type_ptr_to(Type::i8_llcx(llcx)) Type::i8_llcx(llcx).ptr_to()
}
fn ptr_to(&self) -> &Type {
unsafe {
llvm::LLVMPointerType(&self, 0)
}
} }
} }