Skip to content

AST: Don't trigger source location deserialization in request evaluator [5.5] #38498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/swift/AST/AnyFunctionRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ class AnyFunctionRef {
llvm_unreachable("unexpected AnyFunctionRef representation");
}

SourceLoc getLoc() const {
SourceLoc getLoc(bool SerializedOK = true) const {
if (auto afd = TheFunction.dyn_cast<AbstractFunctionDecl *>()) {
return afd->getLoc();
return afd->getLoc(SerializedOK);
}
if (auto ce = TheFunction.dyn_cast<AbstractClosureExpr *>()) {
return ce->getLoc();
Expand Down Expand Up @@ -269,7 +269,7 @@ class AnyFunctionRef {
}

friend SourceLoc extractNearestSourceLoc(AnyFunctionRef fn) {
return fn.getLoc();
return fn.getLoc(/*SerializedOK=*/false);
}

private:
Expand Down
2 changes: 1 addition & 1 deletion lib/AST/Decl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8425,7 +8425,7 @@ void swift::simple_display(llvm::raw_ostream &out, AccessorKind kind) {
}

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

Expand Down