]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #12096 : brson/rust/morestack-addr, r=thestinger
authorbors <bors@rust-lang.org>
Sat, 8 Feb 2014 09:56:30 +0000 (01:56 -0800)
committerbors <bors@rust-lang.org>
Sat, 8 Feb 2014 09:56:30 +0000 (01:56 -0800)
1  2 
src/librustc/middle/trans/intrinsic.rs
src/librustc/middle/typeck/check/mod.rs

index 234b8072decc3eeeeaca2cd5287ef42504c0258a,8896a3de733377857f033f91cd0489261c9940d0..25ecbeaa9a5ed0d5af34a24af16e7b11aac7594e
@@@ -11,6 -11,7 +11,6 @@@
  #[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;
@@@ -325,7 -326,7 +325,7 @@@ pub fn trans_intrinsic(ccx: @CrateConte
          "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);
index 42d9e6f88e2897ad171dbe817c13d1efa37f4b12,b9f7efca67ebc56d9125e8ab7c7a68e651451bf9..81948464d53d6882fc832cff37fb6cd22b2d5b37
@@@ -154,7 -154,7 +154,7 @@@ pub mod method
  /// `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,
  
@@@ -936,7 -936,7 +936,7 @@@ fn compare_impl_method(tcx: ty::ctxt
      };
      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) => {
@@@ -967,8 -967,8 +967,8 @@@ impl AstConv for FnCtxt 
  }
  
  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))
 +        }))
      }
  }
  
@@@ -1075,7 -1076,7 +1075,7 @@@ impl FnCtxt 
      }
  
      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 {
@@@ -2242,7 -2243,7 +2242,7 @@@ pub fn check_expr_with_unifier(fcx: @Fn
  
          // construct the function type
          let fn_ty = astconv::ty_of_closure(fcx,
 -                                           &fcx.infcx(),
 +                                           fcx.infcx(),
                                             expr.id,
                                             sigil,
                                             purity,
@@@ -4127,9 -4128,6 +4127,6 @@@ pub fn check_intrinsic_type(ccx: @Crate
                });
                (0, ~[ td_ptr, visitor_object_ty ], ty::mk_nil())
              }
-             "morestack_addr" => {
-               (0u, ~[], ty::mk_nil_ptr(ccx.tcx))
-             }
              "offset" => {
                (1,
                 ~[