about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRuud van Asseldonk <dev@veniogames.com>2014-11-11 10:15:42 +0100
committerRuud van Asseldonk <dev@veniogames.com>2014-11-21 17:49:11 +0100
commitc724131a8671786e72eef4aea3a369d0541ad482 (patch)
tree776b4d1adb687b3dd5676f60c625b1d698fde2da
parentb781c8b08e5b6b207c0422454ab8f319c90fe64d (diff)
downloadrust-c724131a8671786e72eef4aea3a369d0541ad482.tar.gz
rust-c724131a8671786e72eef4aea3a369d0541ad482.zip
rustc: Change all ABI constants to all caps.
This also removes `box_field_refcnt`. It was not used anywhere.
-rw-r--r--src/librustc_back/abi.rs7
-rw-r--r--src/librustc_trans/trans/base.rs4
-rw-r--r--src/librustc_trans/trans/closure.rs2
-rw-r--r--src/librustc_trans/trans/glue.rs2
4 files changed, 6 insertions, 9 deletions
diff --git a/src/librustc_back/abi.rs b/src/librustc_back/abi.rs
index f89d5d826f5..2f6efbc85a2 100644
--- a/src/librustc_back/abi.rs
+++ b/src/librustc_back/abi.rs
@@ -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.
diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs
index a6f35c29662..85085f46731 100644
--- a/src/librustc_trans/trans/base.rs
+++ b/src/librustc_trans/trans/base.rs
@@ -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);
diff --git a/src/librustc_trans/trans/closure.rs b/src/librustc_trans/trans/closure.rs
index c0c46ed57cc..ca955975dfb 100644
--- a/src/librustc_trans/trans/closure.rs
+++ b/src/librustc_trans/trans/closure.rs
@@ -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 => {
diff --git a/src/librustc_trans/trans/glue.rs b/src/librustc_trans/trans/glue.rs
index f4799d7536d..4ed79837896 100644
--- a/src/librustc_trans/trans/glue.rs
+++ b/src/librustc_trans/trans/glue.rs
@@ -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