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|
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) {
}
fn mk_global(ccx: @crate_ctxt, name: str, llval: ValueRef, internal: bool) ->
- ValueRef {
+ ValueRef unsafe {
let llglobal =
str::as_buf(name,
{|buf|
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",
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,