Skip to content

Commit a35081f

Browse files
committed
Register AA and SILCombine to accept delete notifications.
Add SILCombine and AliasAnalysis as users to the new delete notification mechanism. At the moment the handlers do nothing.
1 parent a91efe7 commit a35081f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

include/swift/SILAnalysis/AliasAnalysis.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ class AliasAnalysis : public SILAnalysis {
8181
/// Returns True if memory of type \p T1 and \p T2 may alias.
8282
bool typesMayAlias(SILType T1, SILType T2);
8383

84+
85+
virtual void handleDeleteNotification(SILInstruction *I) override {
86+
}
87+
8488
public:
8589
AliasAnalysis(SILModule *M) :
8690
SILAnalysis(AnalysisKind::Alias), Mod(M), SEA(nullptr) {}
@@ -89,7 +93,7 @@ class AliasAnalysis : public SILAnalysis {
8993
return S->getKind() == AnalysisKind::Alias;
9094
}
9195

92-
virtual void initialize(SILPassManager *PM);
96+
virtual void initialize(SILPassManager *PM) override;
9397

9498
/// Perform an alias query to see if V1, V2 refer to the same values.
9599
AliasResult alias(SILValue V1, SILValue V2, SILType TBAAType1 = SILType(),
@@ -168,9 +172,10 @@ class AliasAnalysis : public SILAnalysis {
168172
return MemoryBehavior::MayHaveSideEffects == B;
169173
}
170174

171-
virtual void invalidate(SILAnalysis::InvalidationKind K) { }
175+
virtual void invalidate(SILAnalysis::InvalidationKind K) override { }
172176

173-
virtual void invalidate(SILFunction *, SILAnalysis::InvalidationKind K) {
177+
virtual void invalidate(SILFunction *,
178+
SILAnalysis::InvalidationKind K) override {
174179
invalidate(K);
175180
}
176181
};

lib/SILPasses/SILCombiner/SILCombine.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@ class SILCombine : public SILFunctionTransform {
355355
}
356356
}
357357

358+
virtual void handleDeleteNotification(SILInstruction *I) override {
359+
}
360+
358361
StringRef getName() override { return "SIL Combine"; }
359362
};
360363

0 commit comments

Comments
 (0)