Skip to content

Commit a5c2b6b

Browse files
authored
Merge pull request #38497 from slavapestov/request-evaluator-cycle-cycle
AST: Don't trigger source location deserialization in request evaluator
2 parents 08a5c95 + 4c5bda2 commit a5c2b6b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/swift/AST/AnyFunctionRef.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ class AnyFunctionRef {
210210
llvm_unreachable("unexpected AnyFunctionRef representation");
211211
}
212212

213-
SourceLoc getLoc() const {
213+
SourceLoc getLoc(bool SerializedOK = true) const {
214214
if (auto afd = TheFunction.dyn_cast<AbstractFunctionDecl *>()) {
215-
return afd->getLoc();
215+
return afd->getLoc(SerializedOK);
216216
}
217217
if (auto ce = TheFunction.dyn_cast<AbstractClosureExpr *>()) {
218218
return ce->getLoc();
@@ -269,7 +269,7 @@ class AnyFunctionRef {
269269
}
270270

271271
friend SourceLoc extractNearestSourceLoc(AnyFunctionRef fn) {
272-
return fn.getLoc();
272+
return fn.getLoc(/*SerializedOK=*/false);
273273
}
274274

275275
private:

lib/AST/Decl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8523,7 +8523,7 @@ void swift::simple_display(llvm::raw_ostream &out, AccessorKind kind) {
85238523
}
85248524

85258525
SourceLoc swift::extractNearestSourceLoc(const Decl *decl) {
8526-
auto loc = decl->getLoc();
8526+
auto loc = decl->getLoc(/*SerializedOK=*/false);
85278527
if (loc.isValid())
85288528
return loc;
85298529

0 commit comments

Comments
 (0)