We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a8518c commit 490da35Copy full SHA for 490da35
src/comp/middle/trans.rs
@@ -2355,7 +2355,13 @@ impure fn trans_vtbl(@crate_ctxt cx, &ast._obj ob) -> ValueRef {
2355
trans_fn(cx, m.node.meth, m.node.id, m.node.ann);
2356
methods += llfn;
2357
}
2358
- ret C_struct(methods);
+ auto vtbl = C_struct(methods);
2359
+ auto gvar = llvm.LLVMAddGlobal(cx.llmod,
2360
+ val_ty(vtbl),
2361
+ _str.buf("_rust_vtbl" + "." + cx.path));
2362
+ llvm.LLVMSetInitializer(gvar, vtbl);
2363
+ llvm.LLVMSetGlobalConstant(gvar, True);
2364
+ ret gvar;
2365
2366
2367
impure fn trans_obj(@crate_ctxt cx, &ast._obj ob, ast.def_id oid,
0 commit comments