2019-05-19 15:27:28 +00:00
|
|
|
/// This declares a list of types which can be allocated by `Arena`.
|
|
|
|
///
|
|
|
|
/// The `few` modifier will cause allocation to use the shared arena and recording the destructor.
|
|
|
|
/// This is faster and more memory efficient if there's only a few allocations of the type.
|
|
|
|
/// Leaving `few` out will cause the type to get its own dedicated `TypedArena` which is
|
|
|
|
/// faster and more memory efficient if there is lots of allocations.
|
|
|
|
///
|
2020-05-01 20:28:15 +00:00
|
|
|
/// Specifying the `decode` modifier will add decode impls for `&T` and `&[T]` where `T` is the type
|
2019-05-19 15:27:28 +00:00
|
|
|
/// listed. These impls will appear in the implement_ty_decoder! macro.
|
2019-03-29 16:49:11 +00:00
|
|
|
#[macro_export]
|
|
|
|
macro_rules! arena_types {
|
|
|
|
($macro:path, $args:tt, $tcx:lifetime) => (
|
|
|
|
$macro!($args, [
|
2020-06-15 16:29:14 +00:00
|
|
|
[] layouts: rustc_target::abi::Layout,
|
2020-04-03 07:49:21 +00:00
|
|
|
// AdtDef are interned and compared by address
|
2020-06-15 16:29:14 +00:00
|
|
|
[] adt_def: rustc_middle::ty::AdtDef,
|
|
|
|
[] steal_mir: rustc_middle::ty::steal::Steal<rustc_middle::mir::Body<$tcx>>,
|
|
|
|
[decode] mir: rustc_middle::mir::Body<$tcx>,
|
2020-07-03 20:15:27 +00:00
|
|
|
[] steal_promoted:
|
|
|
|
rustc_middle::ty::steal::Steal<
|
|
|
|
rustc_index::vec::IndexVec<
|
|
|
|
rustc_middle::mir::Promoted,
|
|
|
|
rustc_middle::mir::Body<$tcx>
|
|
|
|
>
|
|
|
|
>,
|
2020-07-06 22:34:28 +00:00
|
|
|
[decode] promoted:
|
2020-07-06 21:49:53 +00:00
|
|
|
rustc_index::vec::IndexVec<
|
|
|
|
rustc_middle::mir::Promoted,
|
|
|
|
rustc_middle::mir::Body<$tcx>
|
|
|
|
>,
|
2020-06-15 16:29:14 +00:00
|
|
|
[decode] typeck_results: rustc_middle::ty::TypeckResults<$tcx>,
|
2020-07-03 20:15:27 +00:00
|
|
|
[decode] borrowck_result:
|
|
|
|
rustc_middle::mir::BorrowCheckResult<$tcx>,
|
2020-06-15 16:29:14 +00:00
|
|
|
[decode] unsafety_check_result: rustc_middle::mir::UnsafetyCheckResult,
|
|
|
|
[] const_allocs: rustc_middle::mir::interpret::Allocation,
|
2020-04-03 07:49:21 +00:00
|
|
|
// Required for the incremental on-disk cache
|
2020-06-15 16:29:14 +00:00
|
|
|
[few] mir_keys: rustc_hir::def_id::DefIdSet,
|
|
|
|
[] region_scope_tree: rustc_middle::middle::region::ScopeTree,
|
2018-11-30 22:37:18 +00:00
|
|
|
[] dropck_outlives:
|
2020-03-29 14:41:09 +00:00
|
|
|
rustc_middle::infer::canonical::Canonical<'tcx,
|
|
|
|
rustc_middle::infer::canonical::QueryResponse<'tcx,
|
|
|
|
rustc_middle::traits::query::DropckOutlivesResult<'tcx>
|
2018-11-30 22:37:18 +00:00
|
|
|
>
|
|
|
|
>,
|
|
|
|
[] normalize_projection_ty:
|
2020-03-29 14:41:09 +00:00
|
|
|
rustc_middle::infer::canonical::Canonical<'tcx,
|
|
|
|
rustc_middle::infer::canonical::QueryResponse<'tcx,
|
|
|
|
rustc_middle::traits::query::NormalizationResult<'tcx>
|
2018-11-30 22:37:18 +00:00
|
|
|
>
|
|
|
|
>,
|
|
|
|
[] implied_outlives_bounds:
|
2020-03-29 14:41:09 +00:00
|
|
|
rustc_middle::infer::canonical::Canonical<'tcx,
|
|
|
|
rustc_middle::infer::canonical::QueryResponse<'tcx,
|
|
|
|
Vec<rustc_middle::traits::query::OutlivesBound<'tcx>>
|
2018-11-30 22:37:18 +00:00
|
|
|
>
|
|
|
|
>,
|
|
|
|
[] type_op_subtype:
|
2020-03-29 14:41:09 +00:00
|
|
|
rustc_middle::infer::canonical::Canonical<'tcx,
|
|
|
|
rustc_middle::infer::canonical::QueryResponse<'tcx, ()>
|
2018-11-30 22:37:18 +00:00
|
|
|
>,
|
|
|
|
[] type_op_normalize_poly_fn_sig:
|
2020-03-29 14:41:09 +00:00
|
|
|
rustc_middle::infer::canonical::Canonical<'tcx,
|
|
|
|
rustc_middle::infer::canonical::QueryResponse<'tcx, rustc_middle::ty::PolyFnSig<'tcx>>
|
2018-11-30 22:37:18 +00:00
|
|
|
>,
|
|
|
|
[] type_op_normalize_fn_sig:
|
2020-03-29 14:41:09 +00:00
|
|
|
rustc_middle::infer::canonical::Canonical<'tcx,
|
|
|
|
rustc_middle::infer::canonical::QueryResponse<'tcx, rustc_middle::ty::FnSig<'tcx>>
|
2018-11-30 22:37:18 +00:00
|
|
|
>,
|
|
|
|
[] type_op_normalize_predicate:
|
2020-03-29 14:41:09 +00:00
|
|
|
rustc_middle::infer::canonical::Canonical<'tcx,
|
|
|
|
rustc_middle::infer::canonical::QueryResponse<'tcx, rustc_middle::ty::Predicate<'tcx>>
|
2018-11-30 22:37:18 +00:00
|
|
|
>,
|
|
|
|
[] type_op_normalize_ty:
|
2020-03-29 14:41:09 +00:00
|
|
|
rustc_middle::infer::canonical::Canonical<'tcx,
|
|
|
|
rustc_middle::infer::canonical::QueryResponse<'tcx, rustc_middle::ty::Ty<'tcx>>
|
2018-11-30 22:37:18 +00:00
|
|
|
>,
|
2020-06-15 16:29:14 +00:00
|
|
|
[few] all_traits: Vec<rustc_hir::def_id::DefId>,
|
|
|
|
[few] privacy_access_levels: rustc_middle::middle::privacy::AccessLevels,
|
|
|
|
[few] foreign_module: rustc_middle::middle::cstore::ForeignModule,
|
|
|
|
[few] foreign_modules: Vec<rustc_middle::middle::cstore::ForeignModule>,
|
|
|
|
[] upvars_mentioned: rustc_data_structures::fx::FxIndexMap<rustc_hir::HirId, rustc_hir::Upvar>,
|
|
|
|
[] object_safety_violations: rustc_middle::traits::ObjectSafetyViolation,
|
|
|
|
[] codegen_unit: rustc_middle::mir::mono::CodegenUnit<$tcx>,
|
2020-04-27 17:56:11 +00:00
|
|
|
[] attribute: rustc_ast::Attribute,
|
2020-06-15 16:29:14 +00:00
|
|
|
[] name_set: rustc_data_structures::fx::FxHashSet<rustc_span::symbol::Symbol>,
|
|
|
|
[] hir_id_set: rustc_hir::HirIdSet,
|
2019-12-01 16:33:31 +00:00
|
|
|
|
2020-01-02 00:26:18 +00:00
|
|
|
// Interned types
|
2020-06-15 16:29:14 +00:00
|
|
|
[] tys: rustc_middle::ty::TyS<$tcx>,
|
|
|
|
[] predicates: rustc_middle::ty::PredicateInner<$tcx>,
|
2020-01-02 00:26:18 +00:00
|
|
|
|
2020-02-07 10:45:04 +00:00
|
|
|
// HIR query types
|
2020-06-15 16:29:14 +00:00
|
|
|
[few] indexed_hir: rustc_middle::hir::map::IndexedHir<$tcx>,
|
|
|
|
[few] hir_definitions: rustc_hir::definitions::Definitions,
|
|
|
|
[] hir_owner: rustc_middle::hir::Owner<$tcx>,
|
|
|
|
[] hir_owner_nodes: rustc_middle::hir::OwnerNodes<$tcx>,
|
2020-05-20 21:39:19 +00:00
|
|
|
|
|
|
|
// Note that this deliberately duplicates items in the `rustc_hir::arena`,
|
|
|
|
// since we need to allocate this type on both the `rustc_hir` arena
|
|
|
|
// (during lowering) and the `librustc_middle` arena (for decoding MIR)
|
2020-04-27 17:56:11 +00:00
|
|
|
[decode] asm_template: rustc_ast::InlineAsmTemplatePiece,
|
2020-05-20 21:39:19 +00:00
|
|
|
|
2020-05-26 21:44:43 +00:00
|
|
|
// This is used to decode the &'tcx [Span] for InlineAsm's line_spans.
|
2020-06-15 16:29:14 +00:00
|
|
|
[decode] span: rustc_span::Span,
|
|
|
|
[decode] used_trait_imports: rustc_data_structures::fx::FxHashSet<rustc_hir::def_id::LocalDefId>,
|
2019-03-29 16:49:11 +00:00
|
|
|
], $tcx);
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2020-06-02 17:19:49 +00:00
|
|
|
arena_types!(rustc_arena::declare_arena, [], 'tcx);
|