mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Concurrency] Add a request to retrieve default isolation of a file
The default isolation is computed based on `using` declaration found in the file, if any.
This commit is contained in:
@@ -3829,6 +3829,12 @@ bool SourceFile::FileIDStr::matches(const SourceFile *file) const {
|
||||
fileName == llvm::sys::path::filename(file->getFilename());
|
||||
}
|
||||
|
||||
std::optional<DefaultIsolation> SourceFile::getDefaultIsolation() const {
|
||||
auto &ctx = getASTContext();
|
||||
return evaluateOrDefault(
|
||||
ctx.evaluator, DefaultIsolationInSourceFileRequest{this}, std::nullopt);
|
||||
}
|
||||
|
||||
namespace {
|
||||
class LocalTypeDeclCollector : public ASTWalker {
|
||||
SmallVectorImpl<TypeDecl *> &results;
|
||||
|
||||
Reference in New Issue
Block a user