Expand description
Transforms instances and types for LLVM CFI and cross-language LLVM CFI support using Itanium C++ ABI mangling.
For more information about LLVM CFI and cross-language LLVM CFI support for the Rust compiler, see design document in the tracking issue #89653.
Re-exportsยง
use std::iter;๐use rustc_attr_ir::find_attr;๐use rustc_attr_ir::lang_items::LangItem;๐use rustc_hir as hir;๐use rustc_middle::ty;๐use rustc_middle::ty::AssocContainer;๐use rustc_middle::ty::ExistentialPredicateStableCmpExt as _;๐use rustc_middle::ty::Instance;๐use rustc_middle::ty::IntTy;๐use rustc_middle::ty::List;๐use rustc_middle::ty::TraitRef;๐use rustc_middle::ty::Ty;๐use rustc_middle::ty::TyCtxt;๐use rustc_middle::ty::TypeFoldable;๐use rustc_middle::ty::TypeFolder;๐use rustc_middle::ty::TypeSuperFoldable;๐use rustc_middle::ty::TypeVisitableExt;๐use rustc_middle::ty::UintTy;๐use rustc_middle::ty::Unnormalized;๐use rustc_span::def_id::DefId;๐use rustc_span::DUMMY_SP;๐use rustc_span::bug;๐use rustc_trait_selection::traits;๐use tracing::instrument;๐use tracing::instrument;๐use crate::cfi::typeid::TypeIdOptions;๐use crate::cfi::typeid::itanium_cxx_abi::encode::EncodeTyOptions;๐
Structsยง
- Transform
Ty ๐
Functionsยง
- may_
be_ ๐called_ through_ vtable - Returns whether a trait method may be called through a vtable.
- trait_
object_ ๐ty - Returns the trait object type of a trait reference (i.e., a dyn Trait type with the trait as its principal trait, and the associated types of the trait and its supertraits as its projections), for self to be transformed into when performing type erasure.
- transform_
closure_ ๐like - Performs type erasure for closure-likes (i.e., instances identified by the def id of a closure, coroutine, or coroutine-closure) by transforming self into a trait object of the Fn, FnMut, FnOnce, Coroutine, Future, Iterator, or AsyncIterator trait that defines the call method they are called through, and the instance into a virtual call to that method, to match the type erasure performed during code generation at call sites (see transform_virtual_call). Returns None if the instance is not a closure-like.
- transform_
drop_ ๐glue - Adjusts the type ids of DropGlues to a synthesized Drop trait object.
- transform_
impl_ ๐method - Performs type erasure for trait method implementations in impl blocks by transforming self into a trait object of the trait that defines the method, and the instance into a virtual call to the trait method definition it implements, to match the type erasure performed during code generation at call sites (see transform_virtual_call). Returns None if the instance is not a trait method implementation in an impl block that may be called through a vtable.
- transform_
instance ๐ - Transforms an instance for LLVM CFI and cross-language LLVM CFI support using Itanium C++ ABI mangling.
- transform_
provided_ ๐method - Performs type erasure for provided (default) trait methods in trait blocks and synthetic FnPtrShims by transforming self into a trait object of the trait that defines the method, and the instance into a virtual call to the trait method definition, to match the type erasure performed during code generation at call sites (see transform_virtual_call). Returns None if the instance is not a provided (default) trait method or a synthetic FnPtrShim that may be called through a vtable.
- transform_
virtual_ ๐call - Performs type erasure for virtual method calls (i.e., calls to methods through trait objects) by transforming self into a trait object of the trait that defines the method, to match the type erasure performed on declaration/definition (see transform_impl_method, transform_provided_method, and transform_closure_like).
- transform_
vtable_ ๐shim - Adjusts the type ids of VTableShims to the type id expected in the call sites for the entry in the vtable by transforming self into a trait object of the trait that defines the method, to match the type erasure performed during code generation at call sites (see transform_virtual_call).
Type Aliasesยง
- Transform
TyOptions ๐ - Options for transform_ty.