auto merge of #6706 : brson/rust/glue, r=catamorphism
Instead of `glue_drop1234` it's `Type::<hash>::glue_drop1234` Haven't done any performance testing.
This commit is contained in:
commit
ed9a793d24
2 changed files with 13 additions and 12 deletions
|
@ -727,6 +727,17 @@ pub fn mangle_internal_name_by_type_only(ccx: @CrateContext,
|
||||||
path_name(ccx.sess.ident_of(hash))]);
|
path_name(ccx.sess.ident_of(hash))]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn mangle_internal_name_by_type_and_seq(ccx: @CrateContext,
|
||||||
|
t: ty::t,
|
||||||
|
name: &str) -> ~str {
|
||||||
|
let s = ppaux::ty_to_str(ccx.tcx, t);
|
||||||
|
let hash = get_symbol_hash(ccx, t);
|
||||||
|
return mangle(ccx.sess,
|
||||||
|
~[path_name(ccx.sess.ident_of(s)),
|
||||||
|
path_name(ccx.sess.ident_of(hash)),
|
||||||
|
path_name((ccx.names)(name))]);
|
||||||
|
}
|
||||||
|
|
||||||
pub fn mangle_internal_name_by_path_and_seq(ccx: @CrateContext,
|
pub fn mangle_internal_name_by_path_and_seq(ccx: @CrateContext,
|
||||||
path: path,
|
path: path,
|
||||||
flav: &str) -> ~str {
|
flav: &str) -> ~str {
|
||||||
|
|
|
@ -683,12 +683,7 @@ pub fn declare_tydesc(ccx: @CrateContext, t: ty::t) -> @mut tydesc_info {
|
||||||
let llsize = llsize_of(ccx, llty);
|
let llsize = llsize_of(ccx, llty);
|
||||||
let llalign = llalign_of(ccx, llty);
|
let llalign = llalign_of(ccx, llty);
|
||||||
let addrspace = declare_tydesc_addrspace(ccx, t);
|
let addrspace = declare_tydesc_addrspace(ccx, t);
|
||||||
// FIXME #6574: this triggers duplicate LLVM symbols
|
let name = @mangle_internal_name_by_type_and_seq(ccx, t, "tydesc");
|
||||||
let name = @(if false /*ccx.sess.opts.debuginfo*/ {
|
|
||||||
mangle_internal_name_by_type_only(ccx, t, "tydesc")
|
|
||||||
} else {
|
|
||||||
mangle_internal_name_by_seq(ccx, "tydesc")
|
|
||||||
});
|
|
||||||
note_unique_llvm_symbol(ccx, name);
|
note_unique_llvm_symbol(ccx, name);
|
||||||
debug!("+++ declare_tydesc %s %s", ppaux::ty_to_str(ccx.tcx, t), *name);
|
debug!("+++ declare_tydesc %s %s", ppaux::ty_to_str(ccx.tcx, t), *name);
|
||||||
let gvar = str::as_c_str(*name, |buf| {
|
let gvar = str::as_c_str(*name, |buf| {
|
||||||
|
@ -717,12 +712,7 @@ pub fn declare_generic_glue(ccx: @CrateContext, t: ty::t, llfnty: TypeRef,
|
||||||
name: ~str) -> ValueRef {
|
name: ~str) -> ValueRef {
|
||||||
let _icx = ccx.insn_ctxt("declare_generic_glue");
|
let _icx = ccx.insn_ctxt("declare_generic_glue");
|
||||||
let name = name;
|
let name = name;
|
||||||
// FIXME #6574 this triggers duplicate LLVM symbols
|
let fn_nm = @mangle_internal_name_by_type_and_seq(ccx, t, (~"glue_" + name));
|
||||||
let fn_nm = @(if false /*ccx.sess.opts.debuginfo*/ {
|
|
||||||
mangle_internal_name_by_type_only(ccx, t, (~"glue_" + name))
|
|
||||||
} else {
|
|
||||||
mangle_internal_name_by_seq(ccx, (~"glue_" + name))
|
|
||||||
});
|
|
||||||
debug!("%s is for type %s", *fn_nm, ppaux::ty_to_str(ccx.tcx, t));
|
debug!("%s is for type %s", *fn_nm, ppaux::ty_to_str(ccx.tcx, t));
|
||||||
note_unique_llvm_symbol(ccx, fn_nm);
|
note_unique_llvm_symbol(ccx, fn_nm);
|
||||||
let llfn = decl_cdecl_fn(ccx.llmod, *fn_nm, llfnty);
|
let llfn = decl_cdecl_fn(ccx.llmod, *fn_nm, llfnty);
|
||||||
|
|
Loading…
Reference in a new issue