@@ -4510,8 +4510,8 @@ build_unc_object_type_from_ptr (tree thin_fat_ptr_type, tree object_type,
4510
4510
void
4511
4511
update_pointer_to (tree old_type, tree new_type)
4512
4512
{
4513
- tree ptr = TYPE_POINTER_TO (old_type);
4514
- tree ref = TYPE_REFERENCE_TO (old_type);
4513
+ const tree old_ptr = TYPE_POINTER_TO (old_type);
4514
+ const tree old_ref = TYPE_REFERENCE_TO (old_type);
4515
4515
tree t;
4516
4516
4517
4517
/* If this is the main variant, process all the other variants first. */
@@ -4520,7 +4520,7 @@ update_pointer_to (tree old_type, tree new_type)
4520
4520
update_pointer_to (t, new_type);
4521
4521
4522
4522
/* If no pointers and no references, we are done. */
4523
- if (!ptr && !ref )
4523
+ if (!old_ptr && !old_ref )
4524
4524
return ;
4525
4525
4526
4526
/* Merge the old type qualifiers in the new type.
@@ -4554,12 +4554,13 @@ update_pointer_to (tree old_type, tree new_type)
4554
4554
if (TREE_CODE (new_type) != UNCONSTRAINED_ARRAY_TYPE)
4555
4555
{
4556
4556
tree new_ptr, new_ref;
4557
+ tree ptr, ref;
4557
4558
4558
4559
/* If pointer or reference already points to new type, nothing to do.
4559
4560
This can happen as update_pointer_to can be invoked multiple times
4560
4561
on the same couple of types because of the type variants. */
4561
- if ((ptr && TREE_TYPE (ptr ) == new_type)
4562
- || (ref && TREE_TYPE (ref ) == new_type))
4562
+ if ((old_ptr && TREE_TYPE (old_ptr ) == new_type)
4563
+ || (old_ref && TREE_TYPE (old_ref ) == new_type))
4563
4564
return ;
4564
4565
4565
4566
/* Chain PTR and its variants at the end. */
@@ -4568,13 +4569,13 @@ update_pointer_to (tree old_type, tree new_type)
4568
4569
{
4569
4570
while (TYPE_NEXT_PTR_TO (new_ptr))
4570
4571
new_ptr = TYPE_NEXT_PTR_TO (new_ptr);
4571
- TYPE_NEXT_PTR_TO (new_ptr) = ptr ;
4572
+ TYPE_NEXT_PTR_TO (new_ptr) = old_ptr ;
4572
4573
}
4573
4574
else
4574
- TYPE_POINTER_TO (new_type) = ptr ;
4575
+ TYPE_POINTER_TO (new_type) = old_ptr ;
4575
4576
4576
4577
/* Now adjust them. */
4577
- for (; ptr; ptr = TYPE_NEXT_PTR_TO (ptr))
4578
+ for (ptr = old_ptr ; ptr; ptr = TYPE_NEXT_PTR_TO (ptr))
4578
4579
for (t = TYPE_MAIN_VARIANT (ptr); t; t = TYPE_NEXT_VARIANT (t))
4579
4580
{
4580
4581
TREE_TYPE (t) = new_type;
@@ -4589,13 +4590,13 @@ update_pointer_to (tree old_type, tree new_type)
4589
4590
{
4590
4591
while (TYPE_NEXT_REF_TO (new_ref))
4591
4592
new_ref = TYPE_NEXT_REF_TO (new_ref);
4592
- TYPE_NEXT_REF_TO (new_ref) = ref ;
4593
+ TYPE_NEXT_REF_TO (new_ref) = old_ref ;
4593
4594
}
4594
4595
else
4595
- TYPE_REFERENCE_TO (new_type) = ref ;
4596
+ TYPE_REFERENCE_TO (new_type) = old_ref ;
4596
4597
4597
4598
/* Now adjust them. */
4598
- for (; ref; ref = TYPE_NEXT_REF_TO (ref))
4599
+ for (ref = old_ref ; ref; ref = TYPE_NEXT_REF_TO (ref))
4599
4600
for (t = TYPE_MAIN_VARIANT (ref); t; t = TYPE_NEXT_VARIANT (t))
4600
4601
{
4601
4602
TREE_TYPE (t) = new_type;
@@ -4614,20 +4615,20 @@ update_pointer_to (tree old_type, tree new_type)
4614
4615
{
4615
4616
tree new_ptr = TYPE_POINTER_TO (new_type);
4616
4617
4617
- gcc_assert (TYPE_IS_FAT_POINTER_P (ptr ));
4618
+ gcc_assert (TYPE_IS_FAT_POINTER_P (old_ptr ));
4618
4619
4619
4620
/* If PTR already points to NEW_TYPE, nothing to do. This can happen
4620
4621
since update_pointer_to can be invoked multiple times on the same
4621
4622
couple of types because of the type variants. */
4622
- if (TYPE_UNCONSTRAINED_ARRAY (ptr ) == new_type)
4623
+ if (TYPE_UNCONSTRAINED_ARRAY (old_ptr ) == new_type)
4623
4624
return ;
4624
4625
4625
4626
update_pointer_to
4626
- (TREE_TYPE (TREE_TYPE (TYPE_FIELDS (ptr ))),
4627
+ (TREE_TYPE (TREE_TYPE (TYPE_FIELDS (old_ptr ))),
4627
4628
TREE_TYPE (TREE_TYPE (TYPE_FIELDS (new_ptr))));
4628
4629
4629
4630
update_pointer_to
4630
- (TREE_TYPE (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (ptr )))),
4631
+ (TREE_TYPE (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (old_ptr )))),
4631
4632
TREE_TYPE (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (new_ptr)))));
4632
4633
4633
4634
update_pointer_to (TYPE_OBJECT_RECORD_TYPE (old_type),
0 commit comments