rustc: Emit index of tydescs by addrspace.
This commit is contained in:
parent
c2e99ba826
commit
a7a74c79fa
@ -657,6 +657,16 @@ fn emit_tydescs(ccx: @crate_ctxt) {
|
||||
llvm::LLVMSetInitializer(gvar, tydesc);
|
||||
llvm::LLVMSetGlobalConstant(gvar, True);
|
||||
lib::llvm::SetLinkage(gvar, lib::llvm::InternalLinkage);
|
||||
|
||||
// Index tydesc by addrspace.
|
||||
let llty = T_ptr(ccx.tydesc_type);
|
||||
let addrspace_name = #fmt("_gc_addrspace_metadata_%u",
|
||||
ti.addrspace as uint);
|
||||
let addrspace_gvar = str::as_c_str(addrspace_name, |buf| {
|
||||
llvm::LLVMAddGlobal(ccx.llmod, llty, buf)
|
||||
});
|
||||
lib::llvm::SetLinkage(addrspace_gvar, lib::llvm::InternalLinkage);
|
||||
llvm::LLVMSetInitializer(addrspace_gvar, gvar);
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user