]> git.lizzy.rs Git - rust.git/commitdiff
continue to annotate trans functions as unsafe where neccessary
authorNiko Matsakis <niko@alum.mit.edu>
Mon, 10 Oct 2011 19:21:37 +0000 (12:21 -0700)
committerBrian Anderson <banderson@mozilla.com>
Wed, 12 Oct 2011 23:33:06 +0000 (16:33 -0700)
src/comp/middle/gc.rs
src/comp/middle/shape.rs

index be5376bc2b6bf2720d5b62eaa3c9fe07acd74c78..7de07b55e3b171e2980d106daca28f77e99a9723 100644 (file)
@@ -16,7 +16,8 @@
 
 fn mk_ctxt() -> ctxt { ret @{mutable next_tydesc_num: 0u}; }
 
-fn add_global(ccx: @crate_ctxt, llval: ValueRef, name: str) -> ValueRef {
+fn add_global(ccx: @crate_ctxt, llval: ValueRef, name: str)
+   -> ValueRef unsafe {
     let llglobal =
         str::as_buf(name,
                     {|buf|
@@ -27,7 +28,8 @@ fn add_global(ccx: @crate_ctxt, llval: ValueRef, name: str) -> ValueRef {
     ret llglobal;
 }
 
-fn add_gc_root(cx: @block_ctxt, llval: ValueRef, ty: ty::t) -> @block_ctxt {
+fn add_gc_root(cx: @block_ctxt, llval: ValueRef, ty: ty::t) ->
+   @block_ctxt unsafe {
     let bcx = cx;
     if !type_is_gc_relevant(bcx_tcx(cx), ty) ||
            ty::type_has_dynamic_size(bcx_tcx(cx), ty) {
index 7c54bde66b32f9457c4fc836fd213413b8452dee..17c72d6b6c21b7850779e2ba77945379e78d0765 100644 (file)
@@ -72,7 +72,7 @@ fn eq_res_info(a: res_info, b: res_info) -> bool {
 }
 
 fn mk_global(ccx: @crate_ctxt, name: str, llval: ValueRef, internal: bool) ->
-   ValueRef {
+   ValueRef unsafe {
     let llglobal =
         str::as_buf(name,
                     {|buf|
@@ -245,7 +245,7 @@ fn s_float(_tcx: ty_ctxt) -> u8 {
     ret shape_f64; // TODO: x86-64
 }
 
-fn mk_ctxt(llmod: ModuleRef) -> ctxt {
+fn mk_ctxt(llmod: ModuleRef) -> ctxt unsafe {
     let llshapetablesty = trans_common::T_named_struct("shapes");
     let llshapetables =
         str::as_buf("shapes",
@@ -580,7 +580,7 @@ fn gen_resource_shapes(ccx: @crate_ctxt) -> ValueRef {
     ret mk_global(ccx, "resource_shapes", C_struct(dtors), true);
 }
 
-fn gen_shape_tables(ccx: @crate_ctxt) {
+fn gen_shape_tables(ccx: @crate_ctxt) unsafe {
     let lltagstable = gen_tag_shapes(ccx);
     let llresourcestable = gen_resource_shapes(ccx);
     trans_common::set_struct_body(ccx.shape_cx.llshapetablesty,