Make closure_saved_names_of_captured_variables a query.
This commit is contained in:
parent
18a6d911ca
commit
7d5b2e4926
13 changed files with 71 additions and 39 deletions
|
@ -1031,7 +1031,7 @@ fn build_upvar_field_di_nodes<'ll, 'tcx>(
|
|||
build_field_di_node(
|
||||
cx,
|
||||
closure_or_generator_di_node,
|
||||
capture_name,
|
||||
capture_name.as_str(),
|
||||
cx.size_and_align_of(up_var_ty),
|
||||
layout.fields.offset(index),
|
||||
DIFlags::FlagZero,
|
||||
|
|
|
@ -324,7 +324,7 @@ pub fn build_generator_variant_struct_type_di_node<'ll, 'tcx>(
|
|||
generator_type_di_node: &'ll DIType,
|
||||
generator_layout: &GeneratorLayout<'tcx>,
|
||||
state_specific_upvar_names: &IndexSlice<GeneratorSavedLocal, Option<Symbol>>,
|
||||
common_upvar_names: &[String],
|
||||
common_upvar_names: &IndexSlice<FieldIdx, Symbol>,
|
||||
) -> &'ll DIType {
|
||||
let variant_name = GeneratorSubsts::variant_name(variant_index);
|
||||
let unique_type_id = UniqueTypeId::for_enum_variant_struct_type(
|
||||
|
@ -380,12 +380,13 @@ pub fn build_generator_variant_struct_type_di_node<'ll, 'tcx>(
|
|||
// Fields that are common to all states
|
||||
let common_fields: SmallVec<_> = generator_substs
|
||||
.prefix_tys()
|
||||
.zip(common_upvar_names)
|
||||
.enumerate()
|
||||
.map(|(index, upvar_ty)| {
|
||||
.map(|(index, (upvar_ty, upvar_name))| {
|
||||
build_field_di_node(
|
||||
cx,
|
||||
variant_struct_type_di_node,
|
||||
&common_upvar_names[index],
|
||||
upvar_name.as_str(),
|
||||
cx.size_and_align_of(upvar_ty),
|
||||
generator_type_and_layout.fields.offset(index),
|
||||
DIFlags::FlagZero,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue