about summary refs log tree commit diff
path: root/src/rustc
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-05-25 17:22:14 -0700
committerBrian Anderson <banderson@mozilla.com>2012-05-30 21:23:34 -0700
commita2bbdd3f52a71beabc1beb964772d30045cbe949 (patch)
treeca1f96956b6e304ba31456b9c5ac085dafe3b06b /src/rustc
parent80dc2e11a12c0a77447b74ef3fea3eb3ba44faaa (diff)
downloadrust-a2bbdd3f52a71beabc1beb964772d30045cbe949.tar.gz
rust-a2bbdd3f52a71beabc1beb964772d30045cbe949.zip
rt: Remove upcall_shared_malloc/free/realloc
Diffstat (limited to 'src/rustc')
-rw-r--r--src/rustc/back/upcall.rs10
-rw-r--r--src/rustc/middle/trans/base.rs16
-rw-r--r--src/rustc/middle/trans/common.rs2
-rw-r--r--src/rustc/middle/trans/tvec.rs4
4 files changed, 3 insertions, 29 deletions
diff --git a/src/rustc/back/upcall.rs b/src/rustc/back/upcall.rs
index 6430632d5c0..33fec5fab03 100644
--- a/src/rustc/back/upcall.rs
+++ b/src/rustc/back/upcall.rs
@@ -16,9 +16,6 @@ type upcalls =
      exchange_malloc_dyn: ValueRef,
      exchange_free: ValueRef,
      validate_box: ValueRef,
-     shared_malloc: ValueRef,
-     shared_free: ValueRef,
-     shared_realloc: ValueRef,
      mark: ValueRef,
      vec_grow: ValueRef,
      str_new_uniq: ValueRef,
@@ -75,13 +72,6 @@ fn declare_upcalls(targ_cfg: @session::config,
               nothrow(dv("exchange_free", [T_ptr(T_i8())])),
           validate_box:
               nothrow(dv("validate_box", [T_ptr(T_i8())])),
-          shared_malloc:
-              nothrow(d("shared_malloc", [size_t], T_ptr(T_i8()))),
-          shared_free:
-              nothrow(dv("shared_free", [T_ptr(T_i8())])),
-          shared_realloc:
-              nothrow(d("shared_realloc", [T_ptr(T_i8()), size_t],
-                        T_ptr(T_i8()))),
           mark:
               d("mark", [T_ptr(T_i8())], int_t),
           vec_grow:
diff --git a/src/rustc/middle/trans/base.rs b/src/rustc/middle/trans/base.rs
index 8423aebd979..23884dd0375 100644
--- a/src/rustc/middle/trans/base.rs
+++ b/src/rustc/middle/trans/base.rs
@@ -236,13 +236,6 @@ fn trans_free(cx: block, v: ValueRef) -> block {
     cx
 }
 
-fn trans_shared_free(cx: block, v: ValueRef) -> block {
-    let _icx = cx.insn_ctxt("trans_shared_free");
-    Call(cx, cx.ccx().upcalls.shared_free,
-         [PointerCast(cx, v, T_ptr(T_i8()))]);
-    ret cx;
-}
-
 fn trans_unique_free(cx: block, v: ValueRef) -> block {
     let _icx = cx.insn_ctxt("trans_shared_free");
     Call(cx, cx.ccx().upcalls.exchange_free,
@@ -333,15 +326,6 @@ fn GEP_enum(bcx: block, llblobptr: ValueRef, enum_id: ast::def_id,
     GEPi(bcx, typed_blobptr, [0u, ix])
 }
 
-// trans_shared_malloc: expects a type indicating which pointer type we want
-// and a size indicating how much space we want malloc'd.
-fn shared_malloc(cx: block, llptr_ty: TypeRef, llsize: ValueRef)
-   -> ValueRef {
-    let _icx = cx.insn_ctxt("opaque_shared_malloc");
-    let rval = Call(cx, cx.ccx().upcalls.shared_malloc, [llsize]);
-    PointerCast(cx, rval, llptr_ty)
-}
-
 // Returns a pointer to the body for the box. The box may be an opaque
 // box. The result will be casted to the type of body_t, if it is statically
 // known.
diff --git a/src/rustc/middle/trans/common.rs b/src/rustc/middle/trans/common.rs
index b49272e07b2..194a1993ce3 100644
--- a/src/rustc/middle/trans/common.rs
+++ b/src/rustc/middle/trans/common.rs
@@ -271,7 +271,7 @@ fn add_clean_temp_mem(cx: block, val: ValueRef, ty: ty::t) {
     }
 }
 fn add_clean_free(cx: block, ptr: ValueRef, shared: bool) {
-    let free_fn = if shared { bind base::trans_shared_free(_, ptr) }
+    let free_fn = if shared { bind base::trans_unique_free(_, ptr) }
                   else { bind base::trans_free(_, ptr) };
     in_scope_cx(cx) {|info|
         info.cleanups += [clean_temp(ptr, free_fn,
diff --git a/src/rustc/middle/trans/tvec.rs b/src/rustc/middle/trans/tvec.rs
index a9b78918295..e37806dccf8 100644
--- a/src/rustc/middle/trans/tvec.rs
+++ b/src/rustc/middle/trans/tvec.rs
@@ -2,7 +2,7 @@ import syntax::ast;
 import driver::session::session;
 import lib::llvm::{ValueRef, TypeRef};
 import back::abi;
-import base::{call_memmove, shared_malloc,
+import base::{call_memmove,
                INIT, copy_val, load_if_immediate, get_tydesc,
                sub_block, do_spill_noroot,
                dest, bcx_icx};
@@ -115,7 +115,7 @@ fn make_free_glue(bcx: block, vptr: ValueRef, vec_ty: ty::t) ->
         let bcx = if ty::type_needs_drop(tcx, unit_ty) {
             iter_vec(bcx, vptr, vec_ty, base::drop_ty)
         } else { bcx };
-        base::trans_shared_free(bcx, vptr)
+        base::trans_unique_free(bcx, vptr)
     }
 }