diff --git a/src/comp/middle/gc.rs b/src/comp/middle/gc.rs index be5376bc2b6b..7de07b55e3b1 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 7c54bde66b32..17c72d6b6c21 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,