auto merge of #10040 : thestinger/rust/frame_address, r=alexcrichton
Closes #10001
This commit is contained in:
commit
f27dfa04e5
@ -10,27 +10,23 @@
|
||||
|
||||
#[allow(non_uppercase_pattern_statics)];
|
||||
|
||||
use back::{abi};
|
||||
use back::abi;
|
||||
use lib::llvm::{SequentiallyConsistent, Acquire, Release, Xchg};
|
||||
use lib::llvm::{ValueRef, Pointer, Array, Struct};
|
||||
use lib;
|
||||
use middle::trans::base::*;
|
||||
use middle::trans::build::*;
|
||||
use middle::trans::callee::*;
|
||||
use middle::trans::common::*;
|
||||
use middle::trans::datum::*;
|
||||
use middle::trans::type_of::*;
|
||||
use middle::trans::type_of;
|
||||
use middle::trans::expr::Ignore;
|
||||
use middle::trans::machine;
|
||||
use middle::trans::glue;
|
||||
use middle::ty::FnSig;
|
||||
use middle::ty;
|
||||
use syntax::ast;
|
||||
use syntax::ast_map;
|
||||
use syntax::attr;
|
||||
use syntax::opt_vec;
|
||||
use util::ppaux::{ty_to_str};
|
||||
use util::ppaux::ty_to_str;
|
||||
use middle::trans::machine::llsize_of;
|
||||
use middle::trans::type_::Type;
|
||||
|
||||
@ -387,33 +383,6 @@ pub fn trans_intrinsic(ccx: @mut CrateContext,
|
||||
abi::tydesc_field_visit_glue, None);
|
||||
RetVoid(bcx);
|
||||
}
|
||||
"frame_address" => {
|
||||
let frameaddress = ccx.intrinsics.get_copy(& &"llvm.frameaddress");
|
||||
let frameaddress_val = Call(bcx, frameaddress, [C_i32(0i32)], []);
|
||||
let star_u8 = ty::mk_imm_ptr(
|
||||
bcx.tcx(),
|
||||
ty::mk_mach_uint(ast::ty_u8));
|
||||
let fty = ty::mk_closure(bcx.tcx(), ty::ClosureTy {
|
||||
purity: ast::impure_fn,
|
||||
sigil: ast::BorrowedSigil,
|
||||
onceness: ast::Many,
|
||||
region: ty::re_bound(ty::br_anon(0)),
|
||||
bounds: ty::EmptyBuiltinBounds(),
|
||||
sig: FnSig {
|
||||
bound_lifetime_names: opt_vec::Empty,
|
||||
inputs: ~[ star_u8 ],
|
||||
output: ty::mk_nil()
|
||||
}
|
||||
});
|
||||
let datum = Datum {val: get_param(decl, first_real_arg),
|
||||
mode: ByRef(ZeroMem), ty: fty};
|
||||
let arg_vals = ~[frameaddress_val];
|
||||
bcx = trans_call_inner(
|
||||
bcx, None, fty, ty::mk_nil(),
|
||||
|bcx| Callee {bcx: bcx, data: Closure(datum)},
|
||||
ArgVals(arg_vals), Some(Ignore), DontAutorefArg).bcx;
|
||||
RetVoid(bcx);
|
||||
}
|
||||
"morestack_addr" => {
|
||||
// XXX This is a hack to grab the address of this particular
|
||||
// native function. There should be a general in-language
|
||||
|
@ -3645,21 +3645,6 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
|
||||
});
|
||||
(0, ~[ td_ptr, visitor_object_ty ], ty::mk_nil())
|
||||
}
|
||||
"frame_address" => {
|
||||
let fty = ty::mk_closure(ccx.tcx, ty::ClosureTy {
|
||||
purity: ast::impure_fn,
|
||||
sigil: ast::BorrowedSigil,
|
||||
onceness: ast::Many,
|
||||
region: ty::re_bound(ty::br_anon(0)),
|
||||
bounds: ty::EmptyBuiltinBounds(),
|
||||
sig: ty::FnSig {
|
||||
bound_lifetime_names: opt_vec::Empty,
|
||||
inputs: ~[ty::mk_imm_ptr(ccx.tcx, ty::mk_mach_uint(ast::ty_u8))],
|
||||
output: ty::mk_nil()
|
||||
}
|
||||
});
|
||||
(0u, ~[fty], ty::mk_nil())
|
||||
}
|
||||
"morestack_addr" => {
|
||||
(0u, ~[], ty::mk_nil_ptr(ccx.tcx))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user