#[allow(non_uppercase_pattern_statics)];
use arena::TypedArena;
-use back::abi;
use lib::llvm::{SequentiallyConsistent, Acquire, Release, Xchg};
use lib::llvm::{ValueRef, Pointer, Array, Struct};
use lib;
"get_tydesc" => {
let tp_ty = substs.tys[0];
let static_ti = get_tydesc(ccx, tp_ty);
- glue::lazily_emit_all_tydesc_glue(ccx, static_ti);
+ glue::lazily_emit_visit_glue(ccx, static_ti);
// FIXME (#3730): ideally this shouldn't need a cast,
// but there's a circularity between translating rust types to llvm
let td = get_param(decl, first_real_arg);
let visitor = get_param(decl, first_real_arg + 1u);
let td = PointerCast(bcx, td, ccx.tydesc_type.ptr_to());
- glue::call_tydesc_glue_full(bcx, visitor, td,
- abi::tydesc_field_visit_glue, None);
+ glue::call_visit_glue(bcx, visitor, td, None);
RetVoid(bcx);
}
- "morestack_addr" => {
- // FIXME This is a hack to grab the address of this particular
- // native function. There should be a general in-language
- // way to do this
- let llfty = type_of_rust_fn(bcx.ccx(), false, [], ty::mk_nil());
- let morestack_addr = decl_cdecl_fn(bcx.ccx().llmod, "__morestack",
- llfty, ty::mk_nil());
- let morestack_addr = PointerCast(bcx, morestack_addr,
- Type::nil().ptr_to());
- Ret(bcx, morestack_addr);
- }
"offset" => {
let ptr = get_param(decl, first_real_arg);
let offset = get_param(decl, first_real_arg + 1);
/// `bar()` will each have their own `FnCtxt`, but they will
/// share the inherited fields.
pub struct Inherited {
- infcx: @infer::InferCtxt,
+ infcx: infer::InferCtxt,
locals: @RefCell<HashMap<ast::NodeId, ty::t>>,
param_env: ty::ParameterEnvironment,
};
debug!("trait_fty (post-subst): {}", trait_fty.repr(tcx));
- match infer::mk_subty(infcx, false, infer::MethodCompatCheck(impl_m_span),
+ match infer::mk_subty(&infcx, false, infer::MethodCompatCheck(impl_m_span),
impl_fty, trait_fty) {
result::Ok(()) => {}
result::Err(ref terr) => {
}
impl FnCtxt {
- pub fn infcx(&self) -> @infer::InferCtxt {
- self.inh.infcx
+ pub fn infcx<'a>(&'a self) -> &'a infer::InferCtxt {
+ &self.inh.infcx
}
pub fn err_count_since_creation(&self) -> uint {
}
}
-impl RegionScope for @infer::InferCtxt {
- fn anon_regions(&self,
- span: Span,
- count: uint) -> Result<~[ty::Region], ()> {
- Ok(vec::from_fn(
- count,
- |_| self.next_region_var(infer::MiscVariable(span))))
+impl RegionScope for infer::InferCtxt {
+ fn anon_regions(&self, span: Span, count: uint)
+ -> Result<~[ty::Region], ()> {
+ Ok(vec::from_fn(count, |_| {
+ self.next_region_var(infer::MiscVariable(span))
+ }))
}
}
}
pub fn to_ty(&self, ast_t: &ast::Ty) -> ty::t {
- ast_ty_to_ty(self, &self.infcx(), ast_t)
+ ast_ty_to_ty(self, self.infcx(), ast_t)
}
pub fn pat_to_str(&self, pat: &ast::Pat) -> ~str {
// construct the function type
let fn_ty = astconv::ty_of_closure(fcx,
- &fcx.infcx(),
+ fcx.infcx(),
expr.id,
sigil,
purity,
});
(0, ~[ td_ptr, visitor_object_ty ], ty::mk_nil())
}
- "morestack_addr" => {
- (0u, ~[], ty::mk_nil_ptr(ccx.tcx))
- }
"offset" => {
(1,
~[