rustc: Change all ABI constants to all caps.

This also removes `box_field_refcnt`. It was not used anywhere.
This commit is contained in:
Ruud van Asseldonk 2014-11-11 10:15:42 +01:00
parent b781c8b08e
commit c724131a86
4 changed files with 6 additions and 9 deletions
src
librustc_back
librustc_trans/trans

View File

@ -8,11 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(non_upper_case_globals)]
pub const box_field_refcnt: uint = 0u;
pub const box_field_drop_glue: uint = 1u;
pub const box_field_body: uint = 4u;
pub const BOX_FIELD_DROP_GLUE: uint = 1u;
pub const BOX_FIELD_BODY: uint = 4u;
/// The first half of a fat pointer.
/// - For a closure, this is the code address.

View File

@ -344,7 +344,7 @@ pub fn at_box_body<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
let ccx = bcx.ccx();
let ty = Type::at_box(ccx, type_of(ccx, body_t));
let boxptr = PointerCast(bcx, boxptr, ty.ptr_to());
GEPi(bcx, boxptr, &[0u, abi::box_field_body])
GEPi(bcx, boxptr, &[0u, abi::BOX_FIELD_BODY])
}
fn require_alloc_fn<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
@ -394,7 +394,7 @@ pub fn malloc_raw_dyn_proc<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, t: Ty<'tcx>)
// Allocate space and store the destructor pointer:
let Result {bcx, val: llbox} = malloc_raw_dyn(bcx, ptr_llty, t, size, llalign);
let dtor_ptr = GEPi(bcx, llbox, &[0u, abi::box_field_drop_glue]);
let dtor_ptr = GEPi(bcx, llbox, &[0u, abi::BOX_FIELD_DROP_GLUE]);
let drop_glue_field_ty = type_of(ccx, ty::mk_nil_ptr(bcx.tcx()));
let drop_glue = PointerCast(bcx, glue::get_drop_glue(ccx, ty::mk_uniq(bcx.tcx(), t)),
drop_glue_field_ty);

View File

@ -208,7 +208,7 @@ pub fn store_environment<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
bv.to_string(ccx)).as_slice());
}
let bound_data = GEPi(bcx, llbox, &[0u, abi::box_field_body, i]);
let bound_data = GEPi(bcx, llbox, &[0u, abi::BOX_FIELD_BODY, i]);
match bv.action {
ast::CaptureByValue => {

View File

@ -445,7 +445,7 @@ fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, t: Ty<'tcx>)
let env_ptr_ty = Type::at_box(bcx.ccx(), Type::i8(bcx.ccx())).ptr_to();
let env = PointerCast(bcx, env, env_ptr_ty);
with_cond(bcx, IsNotNull(bcx, env), |bcx| {
let dtor_ptr = GEPi(bcx, env, &[0u, abi::box_field_drop_glue]);
let dtor_ptr = GEPi(bcx, env, &[0u, abi::BOX_FIELD_DROP_GLUE]);
let dtor = Load(bcx, dtor_ptr);
Call(bcx, dtor, &[PointerCast(bcx, box_cell_v, Type::i8p(bcx.ccx()))], None);
bcx