4
4
/// For more information about LLVM CFI and cross-language LLVM CFI support for the Rust compiler,
5
5
/// see design document in the tracking issue #89653.
6
6
use bitflags:: bitflags;
7
- use rustc_middle:: ty:: { FnSig , Instance , Ty , TyCtxt } ;
7
+ use rustc_middle:: ty:: { Instance , Ty , TyCtxt } ;
8
8
use rustc_target:: abi:: call:: FnAbi ;
9
9
use std:: hash:: Hasher ;
10
10
use twox_hash:: XxHash64 ;
11
11
12
12
bitflags ! {
13
- /// Options for typeid_for_fnabi and typeid_for_fnsig .
13
+ /// Options for typeid_for_fnabi.
14
14
#[ derive( Clone , Copy , Debug ) ]
15
15
pub struct TypeIdOptions : u32 {
16
16
const GENERALIZE_POINTERS = 1 ;
@@ -30,15 +30,6 @@ pub fn typeid_for_fnabi<'tcx>(
30
30
typeid_itanium_cxx_abi:: typeid_for_fnabi ( tcx, fn_abi, options)
31
31
}
32
32
33
- /// Returns a type metadata identifier for the specified FnSig.
34
- pub fn typeid_for_fnsig < ' tcx > (
35
- tcx : TyCtxt < ' tcx > ,
36
- fn_sig : & FnSig < ' tcx > ,
37
- options : TypeIdOptions ,
38
- ) -> String {
39
- typeid_itanium_cxx_abi:: typeid_for_fnsig ( tcx, fn_sig, options)
40
- }
41
-
42
33
/// Returns a type metadata identifier for the specified Instance.
43
34
pub fn typeid_for_instance < ' tcx > (
44
35
tcx : TyCtxt < ' tcx > ,
@@ -61,19 +52,6 @@ pub fn kcfi_typeid_for_fnabi<'tcx>(
61
52
hash. finish ( ) as u32
62
53
}
63
54
64
- /// Returns a KCFI type metadata identifier for the specified FnSig.
65
- pub fn kcfi_typeid_for_fnsig < ' tcx > (
66
- tcx : TyCtxt < ' tcx > ,
67
- fn_sig : & FnSig < ' tcx > ,
68
- options : TypeIdOptions ,
69
- ) -> u32 {
70
- // A KCFI type metadata identifier is a 32-bit constant produced by taking the lower half of the
71
- // xxHash64 of the type metadata identifier. (See llvm/llvm-project@cff5bef.)
72
- let mut hash: XxHash64 = Default :: default ( ) ;
73
- hash. write ( typeid_itanium_cxx_abi:: typeid_for_fnsig ( tcx, fn_sig, options) . as_bytes ( ) ) ;
74
- hash. finish ( ) as u32
75
- }
76
-
77
55
/// Returns a KCFI type metadata identifier for the specified Instance.
78
56
pub fn kcfi_typeid_for_instance < ' tcx > (
79
57
tcx : TyCtxt < ' tcx > ,
0 commit comments