Skip to content

Commit 3598994

Browse files
authored
Merge pull request #38498 from slavapestov/request-evaluator-cycle-cycle-5.5
AST: Don't trigger source location deserialization in request evaluator [5.5]
2 parents a4c9b89 + 566d52a commit 3598994

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
@@ -8431,7 +8431,7 @@ void swift::simple_display(llvm::raw_ostream &out, AccessorKind kind) {
84318431
}
84328432

84338433
SourceLoc swift::extractNearestSourceLoc(const Decl *decl) {
8434-
auto loc = decl->getLoc();
8434+
auto loc = decl->getLoc(/*SerializedOK=*/false);
84358435
if (loc.isValid())
84368436
return loc;
84378437

0 commit comments

Comments
 (0)