@@ -226,14 +226,14 @@ using LocalVisitor = llvm::function_ref<bool(IndirectLocalPath &Path, Local L,
226
226
ReferenceKind RK)>;
227
227
} // namespace
228
228
229
- static bool isVarOnPath (IndirectLocalPath &Path, VarDecl *VD) {
229
+ static bool isVarOnPath (const IndirectLocalPath &Path, VarDecl *VD) {
230
230
for (auto E : Path)
231
231
if (E.Kind == IndirectLocalPathEntry::VarInit && E.D == VD)
232
232
return true ;
233
233
return false ;
234
234
}
235
235
236
- static bool pathContainsInit (IndirectLocalPath &Path) {
236
+ static bool pathContainsInit (const IndirectLocalPath &Path) {
237
237
return llvm::any_of (Path, [=](IndirectLocalPathEntry E) {
238
238
return E.Kind == IndirectLocalPathEntry::DefaultInit ||
239
239
E.Kind == IndirectLocalPathEntry::VarInit;
@@ -1076,7 +1076,7 @@ static SourceRange nextPathEntryRange(const IndirectLocalPath &Path, unsigned I,
1076
1076
return E->getSourceRange ();
1077
1077
}
1078
1078
1079
- static bool pathOnlyHandlesGslPointer (IndirectLocalPath &Path) {
1079
+ static bool pathOnlyHandlesGslPointer (const IndirectLocalPath &Path) {
1080
1080
for (const auto &It : llvm::reverse (Path)) {
1081
1081
switch (It.Kind ) {
1082
1082
case IndirectLocalPathEntry::VarInit:
@@ -1124,7 +1124,7 @@ static void checkExprLifetimeImpl(Sema &SemaRef,
1124
1124
1125
1125
// FIXME: consider moving the TemporaryVisitor and visitLocalsRetained*
1126
1126
// functions to a dedicated class.
1127
- auto TemporaryVisitor = [&](IndirectLocalPath &Path, Local L,
1127
+ auto TemporaryVisitor = [&](const IndirectLocalPath &Path, Local L,
1128
1128
ReferenceKind RK) -> bool {
1129
1129
SourceRange DiagRange = nextPathEntryRange (Path, 0 , L);
1130
1130
SourceLocation DiagLoc = DiagRange.getBegin ();
0 commit comments