]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_symbol_mangling/src/typeid.rs
Merge commit 'e36a20c24f35a4cee82bbdc600289104c9237c22' into ra-sync-and-pms-component
[rust.git] / compiler / rustc_symbol_mangling / src / typeid.rs
1 // For more information about type metadata and type metadata identifiers for cross-language LLVM
2 // CFI support, see Type metadata in the design document in the tracking issue #89653.
3
4 use rustc_middle::ty::{FnSig, Ty, TyCtxt};
5 use rustc_target::abi::call::FnAbi;
6
7 mod typeid_itanium_cxx_abi;
8 use typeid_itanium_cxx_abi::TypeIdOptions;
9
10 /// Returns a type metadata identifier for the specified FnAbi.
11 pub fn typeid_for_fnabi<'tcx>(tcx: TyCtxt<'tcx>, fn_abi: &FnAbi<'tcx, Ty<'tcx>>) -> String {
12     typeid_itanium_cxx_abi::typeid_for_fnabi(tcx, fn_abi, TypeIdOptions::NO_OPTIONS)
13 }
14
15 /// Returns a type metadata identifier for the specified FnSig.
16 pub fn typeid_for_fnsig<'tcx>(tcx: TyCtxt<'tcx>, fn_sig: &FnSig<'tcx>) -> String {
17     typeid_itanium_cxx_abi::typeid_for_fnsig(tcx, fn_sig, TypeIdOptions::NO_OPTIONS)
18 }