Skip to main content Module base Copy item path Source use std::collections::BTreeSet ; π use std::sync::Arc ; π use std::time::Duration ; π use std::time::Instant ; π use std::cmp ; π use std::iter ; π use itertools::Itertools ; π use rustc_abi::FIRST_VARIANT ; π use rustc_ast::expand::allocator::ALLOC_ERROR_HANDLER ; π use rustc_ast::expand::allocator::ALLOCATOR_METHODS ; π use rustc_ast::expand::allocator::AllocatorKind ; π use rustc_ast::expand::allocator::AllocatorMethod ; π use rustc_ast::expand::allocator::AllocatorMethodInput ; π use rustc_ast::expand::allocator::AllocatorTy ; π use rustc_attr_ir::lang_items::LangItem ; π use rustc_attr_ir::target::Target ; π use rustc_attr_ir::DebuggerVisualizerType ; π use rustc_attr_ir::EiiDecl ; π use rustc_attr_ir::EiiImpl ; π use rustc_attr_ir::OptimizeAttr ; π use rustc_attr_ir::find_attr ; π use rustc_data_structures::fx::FxHashMap ; π use rustc_data_structures::fx::FxIndexMap ; π use rustc_data_structures::fx::FxIndexSet ; π use rustc_data_structures::profiling::get_resident_set_size ; π use rustc_data_structures::profiling::print_time_passes_entry ; π use rustc_data_structures::sync::IntoDynSyncSend ; π use rustc_data_structures::sync::par_map ; π use rustc_data_structures::unord::UnordMap ; π use rustc_hir as hir; π use rustc_hir::def_id::CrateNum ; π use rustc_hir::def_id::DefId ; π use rustc_hir::def_id::LOCAL_CRATE ; π use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs ; π use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile ; π use rustc_middle::middle::dependency_format::Dependencies ; π use rustc_middle::middle::dependency_format::Linkage ; π use rustc_middle::middle::exported_symbols ; π use rustc_middle::middle::exported_symbols::SymbolExportKind ; π use rustc_middle::middle::lang_items ; π use rustc_middle::mir::interpret::CTFE_ALLOC_SALT ; π use rustc_middle::mir::interpret::ErrorHandled ; π use rustc_middle::mir::interpret::Scalar ; π use rustc_middle::mir::BinOp ; π use rustc_middle::mir::ConstValue ; π use rustc_middle::mono::CodegenUnit ; π use rustc_middle::mono::CodegenUnitNameBuilder ; π use rustc_middle::mono::MonoItem ; π use rustc_middle::mono::MonoItemPartitions ; π use rustc_middle::query::Providers ; π use rustc_middle::ty::layout::HasTyCtxt ; π use rustc_middle::ty::layout::HasTypingEnv ; π use rustc_middle::ty::layout::LayoutOf ; π use rustc_middle::ty::layout::TyAndLayout ; π use rustc_middle::ty ; π use rustc_middle::ty::Instance ; π use rustc_middle::ty::PatternKind ; π use rustc_middle::ty::Ty ; π use rustc_middle::ty::TyCtxt ; π use rustc_middle::ty::UintTy ; π use rustc_middle::ty::Unnormalized ; π use rustc_session::config ; π use rustc_session::config::EntryFnType ; π use rustc_span::DUMMY_SP ; π use rustc_span::Symbol ; π use rustc_span::bug ; π use rustc_span::span_bug ; π use rustc_structures::CrateType ; π use rustc_symbol_mangling::mangle_internal_symbol ; π use rustc_target::spec::Arch ; π use rustc_target::spec::Os ; π use rustc_target::spec::Target as TargetSpec; π use rustc_trait_selection::infer::BoundRegionConversionTime ; π use rustc_trait_selection::infer::TyCtxtInferExt ; π use rustc_trait_selection::traits::ObligationCause ; π use rustc_trait_selection::traits::ObligationCtxt ; π use tracing::debug ; π use tracing::info ; π use crate::assert_module_sources::CguReuse ; π use crate::back::link::are_upstream_rust_objects_already_included ; π use crate::back::write::ComputedLtoType ; π use crate::back::write::ModuleConfig ; π use crate::back::write::OngoingCodegen ; π use crate::back::write::compute_per_cgu_lto_type ; π use crate::back::write::start_async_codegen ; π use crate::back::write::submit_codegened_module_to_llvm ; π use crate::back::write::submit_post_lto_module_to_llvm ; π use crate::back::write::submit_pre_lto_module_to_llvm ; π use crate::common ; π use crate::common::IntPredicate ; π use crate::common::RealPredicate ; π use crate::meth::VirtualIndex ; π use crate::mir::operand::OperandValue ; π use crate::mir::place::PlaceRef ; π use crate::CachedModuleCodegen ; π use crate::CodegenLintLevelSpecs ; π use crate::CrateInfo ; π use crate::EiiLinkageImplInfo ; π use crate::EiiLinkageInfo ; π use crate::ModuleCodegen ; π use crate::ModuleKind ; π use crate::diagnostics ; π use crate::meth ; π use crate::mir ; π use crate::traits ::*; π allocator_kind_for_codegen Decide allocator kind to codegen. If Some(_) this will be the same as
tcx.allocator_kind, but it may be None in more cases (e.g. if using
allocator definitions from a dylib dependency). allocator_shim_contents bin_op_to_fcmp_predicate π bin_op_to_icmp_predicate π build_shift_expr_rhs π Returns rhs sufficiently masked, truncated, and/or extended so that it can be used to shift
lhs: it has the same size as lhs, and the value, when interpreted unsigned (no matter its
type), will not exceed the size of lhs. codegen_crate codegen_global_asm codegen_instance π coerce_unsized_into π Coerces src, which is a reference to a value of type src_ty,
to a value of type dst_ty, and stores the result in dst. collect_debugger_visualizers_transitive This function returns all of the debugger visualizers specified for the
current crate as well as all upstream crates transitively that match the
visualizer_type specified. collect_eii_linkage π compare_simd_types determine_cgu_reuse eii_linkage_needed π get_argc_argv π Obtain the argc and argv values to pass to the rust start function
(i.e., the βstartβ lang item). is_call_from_compiler_builtins_to_upstream_monomorphization Returns whether a call from the current crate to the Instance would produce a call
from compiler_builtins to a symbol the linker must resolve. maybe_create_entry_wrapper Creates the main function which will initialize the rust runtime and call
users main function. needs_allocator_shim_for_linking π Decide if this particular crate type needs an allocator shim linked in.
This may return true even when allocator_kind_for_codegen returns false. In
this case no allocator shim shall be linked. provide π unsize_ptr π Coerces src to dst_ty. src_ty must be a pointer. unsized_info π Retrieves the information we are losing (making dynamic) in an unsizing
adjustment. validate_trivial_unsize Codegen takes advantage of the additional assumption, where if the
principal trait def id of whatβs being casted doesnβt change,
then we donβt need to adjust the vtable at all. This
corresponds to the fact that dyn Tr<A>: Unsize<dyn Tr<B>>
requires that A = B; we donβt allow upcasting objects
between the same trait with different args. If we, for
some reason, were to relax the Unsize trait, it could become
unsound, so letβs validate here that the trait refs are subtypes. wants_msvc_seh Returns true if this sessionβs target will use SEH-based unwinding. wants_new_eh_instructions π Returns true if this sessionβs target requires the new exception
handling LLVM IR instructions (catchpad / cleanuppad / β¦ instead
of landingpad) wants_wasm_eh