Skip to content

Commit 02dcd5d

Browse files
committed
AST/Sema: Sink AvailabilityScopeBuilder from Sema to AST.
1 parent ff9b541 commit 02dcd5d

File tree

7 files changed

+1208
-1155
lines changed

7 files changed

+1208
-1155
lines changed

include/swift/AST/AvailabilityScope.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ class AvailabilityScope : public ASTAllocated<AvailabilityScope> {
185185
SourceRange SrcRange, const AvailabilityContext Info);
186186

187187
public:
188+
/// Constructs the root availability scope for the given file and builds out
189+
/// the scope tree for the top level contents of the file.
190+
static AvailabilityScope *getOrBuildForSourceFile(SourceFile &SF);
191+
188192
/// Create the root availability scope for the given SourceFile.
189193
static AvailabilityScope *createForSourceFile(SourceFile *SF,
190194
const AvailabilityContext Info);

include/swift/AST/SourceFile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ class SourceFile final : public FileUnit {
776776

777777
/// Get the root availability scope for the file. The root scope may be
778778
/// null if the scope tree has not been built yet. Use
779-
/// TypeChecker::getOrBuildAvailabilityScope() to get a built
779+
/// `AvailabilityScope::getOrBuildForSourceFile()` to get a built
780780
/// root of the tree.
781781
AvailabilityScope *getAvailabilityScope() const;
782782

0 commit comments

Comments
 (0)