@@ -519,23 +519,10 @@ class ElementUseCollector {
519
519
const DIMemoryObjectInfo &TheMemory;
520
520
DIElementUseInfo &UseInfo;
521
521
522
- // / This is true if definite initialization has finished processing assign
523
- // / and other ambiguous instructions into init vs assign classes.
524
- bool isDefiniteInitFinished;
525
-
526
522
// / IsSelfOfNonDelegatingInitializer - This is true if we're looking at the
527
523
// / top level of a 'self' variable in a non-delegating init method.
528
524
bool IsSelfOfNonDelegatingInitializer;
529
525
530
- // / How should address_to_pointer be handled?
531
- // /
532
- // / In DefiniteInitialization it is considered as an inout parameter to get
533
- // / diagnostics about passing a let variable to an inout mutable-pointer
534
- // / argument.
535
- // / In PredictableMemOpt it is considered as an escape point to be
536
- // / conservative.
537
- bool TreatAddressToPointerAsInout;
538
-
539
526
// / When walking the use list, if we index into a struct element, keep track
540
527
// / of this, so that any indexes into tuple subelements don't affect the
541
528
// / element we attribute an access to.
@@ -547,11 +534,9 @@ class ElementUseCollector {
547
534
548
535
public:
549
536
ElementUseCollector (const DIMemoryObjectInfo &TheMemory,
550
- DIElementUseInfo &UseInfo, bool isDefiniteInitFinished,
551
- bool TreatAddressToPointerAsInout)
537
+ DIElementUseInfo &UseInfo)
552
538
: Module(TheMemory.MemoryInst->getModule ()), TheMemory(TheMemory),
553
- UseInfo(UseInfo), isDefiniteInitFinished(isDefiniteInitFinished),
554
- TreatAddressToPointerAsInout(TreatAddressToPointerAsInout) {}
539
+ UseInfo(UseInfo) {}
555
540
556
541
// / This is the main entry point for the use walker. It collects uses from
557
542
// / the address and the refcount result of the allocation.
@@ -775,8 +760,6 @@ void ElementUseCollector::collectUses(SILValue Pointer, unsigned BaseEltNo) {
775
760
Kind = DIUseKind::PartialStore; \
776
761
else if (SWI->isInitializationOfDest ()) \
777
762
Kind = DIUseKind::Initialization; \
778
- else if (isDefiniteInitFinished) \
779
- Kind = DIUseKind::Assign; \
780
763
else \
781
764
Kind = DIUseKind::InitOrAssign; \
782
765
trackUse (DIMemoryUse (User, Kind, BaseEltNo, 1 )); \
@@ -803,8 +786,6 @@ void ElementUseCollector::collectUses(SILValue Pointer, unsigned BaseEltNo) {
803
786
Kind = DIUseKind::PartialStore;
804
787
else if (CAI->isInitializationOfDest ())
805
788
Kind = DIUseKind::Initialization;
806
- else if (isDefiniteInitFinished)
807
- Kind = DIUseKind::Assign;
808
789
else
809
790
Kind = DIUseKind::InitOrAssign;
810
791
@@ -900,7 +881,7 @@ void ElementUseCollector::collectUses(SILValue Pointer, unsigned BaseEltNo) {
900
881
llvm_unreachable (" bad parameter convention" );
901
882
}
902
883
903
- if (isa<AddressToPointerInst>(User) && TreatAddressToPointerAsInout ) {
884
+ if (isa<AddressToPointerInst>(User)) {
904
885
// address_to_pointer is a mutable escape, which we model as an inout use.
905
886
addElementUses (BaseEltNo, PointeeType, User,
906
887
DIUseKind::InOutArgument);
@@ -1830,12 +1811,11 @@ static bool shouldPerformClassInitSelf(const DIMemoryObjectInfo &MemoryInfo) {
1830
1811
MemoryInfo.isDerivedClassSelfOnly ();
1831
1812
}
1832
1813
1833
- // / collectDIElementUsesFrom - Analyze all uses of the specified allocation
1834
- // / instruction (alloc_box, alloc_stack or mark_uninitialized), classifying them
1835
- // / and storing the information found into the Uses and Releases lists.
1814
+ // / Analyze all uses of the specified allocation instruction (alloc_box,
1815
+ // / alloc_stack or mark_uninitialized), classifying them and storing the
1816
+ // / information found into the Uses and Releases lists.
1836
1817
void swift::ownership::collectDIElementUsesFrom (
1837
- const DIMemoryObjectInfo &MemoryInfo, DIElementUseInfo &UseInfo,
1838
- bool isDIFinished, bool TreatAddressToPointerAsInout) {
1818
+ const DIMemoryObjectInfo &MemoryInfo, DIElementUseInfo &UseInfo) {
1839
1819
1840
1820
if (shouldPerformClassInitSelf (MemoryInfo)) {
1841
1821
ClassInitElementUseCollector UseCollector (MemoryInfo, UseInfo);
@@ -1852,7 +1832,5 @@ void swift::ownership::collectDIElementUsesFrom(
1852
1832
return ;
1853
1833
}
1854
1834
1855
- ElementUseCollector (MemoryInfo, UseInfo, isDIFinished,
1856
- TreatAddressToPointerAsInout)
1857
- .collectFrom ();
1835
+ ElementUseCollector (MemoryInfo, UseInfo).collectFrom ();
1858
1836
}
0 commit comments