diff options
| author | Masaki Hara <ackie.h.gmai@gmail.com> | 2018-09-10 23:01:46 +0900 |
|---|---|---|
| committer | Masaki Hara <ackie.h.gmai@gmail.com> | 2018-10-24 21:59:06 +0900 |
| commit | 824315a7220895b0e21783726eb2b7856bc27406 (patch) | |
| tree | b5a14c2c03209e1609f9636a391297c9f80aae72 /src/librustc_codegen_utils | |
| parent | 6fd914a1afc3d0d0f86e8a9a1bfacd55be053d58 (diff) | |
| download | rust-824315a7220895b0e21783726eb2b7856bc27406.tar.gz rust-824315a7220895b0e21783726eb2b7856bc27406.zip | |
Distinguish vtable shims in symbol paths.
Diffstat (limited to 'src/librustc_codegen_utils')
| -rw-r--r-- | src/librustc_codegen_utils/symbol_names.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/librustc_codegen_utils/symbol_names.rs b/src/librustc_codegen_utils/symbol_names.rs index c1e80234a77..27700bab245 100644 --- a/src/librustc_codegen_utils/symbol_names.rs +++ b/src/librustc_codegen_utils/symbol_names.rs @@ -219,6 +219,9 @@ fn get_symbol_hash<'a, 'tcx>( .hash_stable(&mut hcx, &mut hasher); (&tcx.crate_disambiguator(instantiating_crate)).hash_stable(&mut hcx, &mut hasher); } + + let is_vtable_shim = instance.is_vtable_shim(); + is_vtable_shim.hash_stable(&mut hcx, &mut hasher); }); // 64 bits should be enough to avoid collisions. @@ -322,7 +325,13 @@ fn compute_symbol_name<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, instance: Instance let hash = get_symbol_hash(tcx, def_id, instance, instance_ty, substs); - SymbolPathBuffer::from_interned(tcx.def_symbol_name(def_id)).finish(hash) + let mut buf = SymbolPathBuffer::from_interned(tcx.def_symbol_name(def_id)); + + if instance.is_vtable_shim() { + buf.push("{{vtable-shim}}"); + } + + buf.finish(hash) } // Follow C++ namespace-mangling style, see |
