Skip to content

Commit 8d7f1b7

Browse files
committed
[AST] Separate SourceFile from FileUnit.h
Like the last commit, SourceFile is used a lot by Parse and Sema, but less so by the ClangImporter and (de)Serialization. Split it out to cut down on recompilation times when something changes. This commit does /not/ split the implementation of SourceFile out of Module.cpp, which is where most of it lives. That might also be a reasonable change, but the reason I was reluctant to is because a number of SourceFile members correspond to the entry points in ModuleDecl. Someone else can pick this up later if they decide it's a good idea. No functionality change.
1 parent 853caa6 commit 8d7f1b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+555
-522
lines changed

include/swift/AST/FileUnit.h

Lines changed: 0 additions & 462 deletions
Large diffs are not rendered by default.

include/swift/AST/SourceFile.h

Lines changed: 483 additions & 0 deletions
Large diffs are not rendered by default.

include/swift/Frontend/Frontend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020

2121
#include "swift/AST/DiagnosticConsumer.h"
2222
#include "swift/AST/DiagnosticEngine.h"
23-
#include "swift/AST/FileUnit.h"
2423
#include "swift/AST/IRGenOptions.h"
2524
#include "swift/AST/LinkLibrary.h"
2625
#include "swift/AST/Module.h"
2726
#include "swift/AST/SILOptions.h"
2827
#include "swift/AST/SearchPathOptions.h"
28+
#include "swift/AST/SourceFile.h"
2929
#include "swift/Basic/DiagnosticOptions.h"
3030
#include "swift/Basic/LangOptions.h"
3131
#include "swift/Basic/SourceManager.h"

include/swift/IDE/IDERequests.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
#include "swift/AST/ASTTypeIDs.h"
2020
#include "swift/AST/Evaluator.h"
21-
#include "swift/AST/FileUnit.h"
2221
#include "swift/AST/SimpleRequest.h"
22+
#include "swift/AST/SourceFile.h"
2323
#include "swift/IDE/Utils.h"
2424
#include "swift/IDE/IDETypeIDs.h"
2525

include/swift/Migrator/ASTMigratorPass.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#define SWIFT_MIGRATOR_ASTMIGRATORPASS_H
2020

2121
#include "swift/AST/ASTContext.h"
22+
#include "swift/AST/SourceFile.h"
2223
#include "swift/Migrator/EditorAdapter.h"
2324

2425
namespace swift {

lib/AST/ASTContext.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "swift/AST/PropertyWrappers.h"
3838
#include "swift/AST/ProtocolConformance.h"
3939
#include "swift/AST/RawComment.h"
40+
#include "swift/AST/SourceFile.h"
4041
#include "swift/AST/SubstitutionMap.h"
4142
#include "swift/AST/SILLayout.h"
4243
#include "swift/AST/TypeCheckRequests.h"

lib/AST/ASTDumper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
#include "swift/AST/ASTContext.h"
1818
#include "swift/AST/ASTPrinter.h"
1919
#include "swift/AST/ASTVisitor.h"
20-
#include "swift/AST/FileUnit.h"
2120
#include "swift/AST/ForeignErrorConvention.h"
2221
#include "swift/AST/GenericEnvironment.h"
2322
#include "swift/AST/Initializer.h"
2423
#include "swift/AST/ParameterList.h"
2524
#include "swift/AST/ProtocolConformance.h"
25+
#include "swift/AST/SourceFile.h"
2626
#include "swift/AST/TypeVisitor.h"
2727
#include "swift/Basic/Defer.h"
2828
#include "swift/Basic/QuotedString.h"

lib/AST/ASTScope.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
#include "swift/AST/ASTWalker.h"
2020
#include "swift/AST/Decl.h"
2121
#include "swift/AST/Expr.h"
22-
#include "swift/AST/FileUnit.h"
2322
#include "swift/AST/Initializer.h"
2423
#include "swift/AST/LazyResolver.h"
2524
#include "swift/AST/Module.h"
2625
#include "swift/AST/NameLookup.h"
2726
#include "swift/AST/ParameterList.h"
2827
#include "swift/AST/Pattern.h"
28+
#include "swift/AST/SourceFile.h"
2929
#include "swift/AST/Stmt.h"
3030
#include "swift/AST/TypeRepr.h"
3131
#include "swift/Basic/NullablePtr.h"

lib/AST/ASTScopeCreation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
#include "swift/AST/Attr.h"
2121
#include "swift/AST/Decl.h"
2222
#include "swift/AST/Expr.h"
23-
#include "swift/AST/FileUnit.h"
2423
#include "swift/AST/Initializer.h"
2524
#include "swift/AST/LazyResolver.h"
2625
#include "swift/AST/Module.h"
2726
#include "swift/AST/ParameterList.h"
2827
#include "swift/AST/Pattern.h"
28+
#include "swift/AST/SourceFile.h"
2929
#include "swift/AST/Stmt.h"
3030
#include "swift/AST/TypeRepr.h"
3131
#include "swift/Basic/STLExtras.h"

lib/AST/ASTScopeLookup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
#include "swift/AST/ASTWalker.h"
2020
#include "swift/AST/Decl.h"
2121
#include "swift/AST/Expr.h"
22-
#include "swift/AST/FileUnit.h"
2322
#include "swift/AST/Initializer.h"
2423
#include "swift/AST/LazyResolver.h"
2524
#include "swift/AST/Module.h"
2625
#include "swift/AST/NameLookup.h"
2726
#include "swift/AST/ParameterList.h"
2827
#include "swift/AST/Pattern.h"
28+
#include "swift/AST/SourceFile.h"
2929
#include "swift/AST/Stmt.h"
3030
#include "swift/AST/TypeRepr.h"
3131
#include "swift/Basic/STLExtras.h"

0 commit comments

Comments
 (0)