Skip to content

Commit 076d70a

Browse files
committed
Update getLifetimeDependenceInfo to getLifetimeDependencies in CSSimplify
1 parent fecd2b4 commit 076d70a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

include/swift/AST/LifetimeDependence.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,20 @@ class LifetimeDependenceInfo {
230230
static std::optional<llvm::ArrayRef<LifetimeDependenceInfo>>
231231
get(FunctionTypeRepr *funcRepr, ArrayRef<SILParameterInfo> params,
232232
ArrayRef<SILResultInfo> results, DeclContext *dc);
233+
234+
bool operator==(const LifetimeDependenceInfo &other) const {
235+
return this->isImmortal() == other.isImmortal() &&
236+
this->getTargetIndex() == other.getTargetIndex() &&
237+
this->getInheritIndices() == other.getInheritIndices() &&
238+
this->getScopeIndices() == other.getScopeIndices();
239+
}
240+
241+
bool operator!=(const LifetimeDependenceInfo &other) const {
242+
return this->isImmortal() != other.isImmortal() &&
243+
this->getTargetIndex() != other.getTargetIndex() &&
244+
this->getInheritIndices() != other.getInheritIndices() &&
245+
this->getScopeIndices() != other.getScopeIndices();
246+
}
233247
};
234248

235249
std::optional<LifetimeDependenceInfo>

lib/Sema/CSSimplify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3248,7 +3248,7 @@ ConstraintSystem::matchFunctionTypes(FunctionType *func1, FunctionType *func2,
32483248
if (!matchFunctionIsolations(func1, func2, kind, flags, locator))
32493249
return getTypeMatchFailure(locator);
32503250

3251-
if (func1->getLifetimeDependenceInfo() != func2->getLifetimeDependenceInfo()) {
3251+
if (func1->getLifetimeDependencies() != func2->getLifetimeDependencies()) {
32523252
return getTypeMatchFailure(locator);
32533253
}
32543254

0 commit comments

Comments
 (0)