diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2011-10-10 12:21:37 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-10-12 16:33:06 -0700 |
| commit | f2cd33df72cfe9648b668d8822a785dc81bee908 (patch) | |
| tree | e3df8bc6c89df79eed3543d62f2fc49dec22c44a /src | |
| parent | 2094668949200aa692caa1df261cf7b1e9686b64 (diff) | |
| download | rust-f2cd33df72cfe9648b668d8822a785dc81bee908.tar.gz rust-f2cd33df72cfe9648b668d8822a785dc81bee908.zip | |
continue to annotate trans functions as unsafe where neccessary
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp/middle/gc.rs | 6 | ||||
| -rw-r--r-- | src/comp/middle/shape.rs | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/comp/middle/gc.rs b/src/comp/middle/gc.rs index be5376bc2b6..7de07b55e3b 100644 --- a/src/comp/middle/gc.rs +++ b/src/comp/middle/gc.rs @@ -16,7 +16,8 @@ type ctxt = @{mutable next_tydesc_num: uint}; 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) { diff --git a/src/comp/middle/shape.rs b/src/comp/middle/shape.rs index 7c54bde66b3..17c72d6b6c2 100644 --- a/src/comp/middle/shape.rs +++ b/src/comp/middle/shape.rs @@ -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, |
