Skip to content

Commit 8ff1dac

Browse files
authored
[AST] Break some header dependencies for faster rebuilds (#27374)
DiagnosticEngine.h no longer depends on Attr.h. Expr.h no longer depends on TypeRepr.h. No functionality change.
1 parent c0a57b6 commit 8ff1dac

File tree

19 files changed

+27
-5
lines changed

19 files changed

+27
-5
lines changed

include/swift/AST/ASTTypeIDs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include "swift/Basic/TypeID.h"
2222
namespace swift {
2323

24+
class AbstractFunctionDecl;
25+
class BraceStmt;
2426
class CustomAttr;
2527
class Decl;
2628
class GenericParamList;

include/swift/AST/DiagnosticEngine.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@
1818
#ifndef SWIFT_BASIC_DIAGNOSTICENGINE_H
1919
#define SWIFT_BASIC_DIAGNOSTICENGINE_H
2020

21-
#include "swift/AST/Attr.h"
2221
#include "swift/AST/TypeLoc.h"
2322
#include "swift/AST/DeclNameLoc.h"
2423
#include "swift/AST/DiagnosticConsumer.h"
2524
#include "llvm/ADT/StringMap.h"
2625
#include "llvm/Support/Allocator.h"
26+
#include "llvm/Support/VersionTuple.h"
2727

2828
namespace swift {
2929
class Decl;
30+
class DeclAttribute;
3031
class DiagnosticEngine;
3132
class SourceManager;
3233
class ValueDecl;

include/swift/AST/Expr.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919

2020
#include "swift/AST/CaptureInfo.h"
2121
#include "swift/AST/ConcreteDeclRef.h"
22+
#include "swift/AST/DeclContext.h"
2223
#include "swift/AST/DeclNameLoc.h"
2324
#include "swift/AST/FunctionRefKind.h"
2425
#include "swift/AST/ProtocolConformanceRef.h"
2526
#include "swift/AST/TrailingCallArguments.h"
2627
#include "swift/AST/TypeAlignments.h"
2728
#include "swift/AST/TypeLoc.h"
28-
#include "swift/AST/TypeRepr.h"
2929
#include "swift/AST/Availability.h"
3030
#include "swift/Basic/InlineBitfield.h"
3131
#include "llvm/Support/TrailingObjects.h"
@@ -40,7 +40,9 @@ namespace swift {
4040
class ArchetypeType;
4141
class ASTContext;
4242
class AvailabilitySpec;
43+
class IdentTypeRepr;
4344
class Type;
45+
class TypeRepr;
4446
class ValueDecl;
4547
class Decl;
4648
class DeclRefExpr;

include/swift/Parse/ASTGen.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
#include "llvm/ADT/DenseMap.h"
2222

2323
namespace swift {
24+
class ComponentIdentTypeRepr;
25+
class TupleTypeRepr;
26+
2427
/// Generates AST nodes from Syntax nodes.
2528
class Parser;
2629
class ASTGen {

lib/AST/ASTVerifier.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "swift/AST/ProtocolConformance.h"
3232
#include "swift/AST/SourceFile.h"
3333
#include "swift/AST/Stmt.h"
34+
#include "swift/AST/TypeRepr.h"
3435
#include "swift/Basic/SourceManager.h"
3536
#include "swift/Subsystems.h"
3637
#include "llvm/ADT/SmallBitVector.h"

lib/AST/Attr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "swift/AST/Expr.h"
2222
#include "swift/AST/GenericEnvironment.h"
2323
#include "swift/AST/Module.h"
24+
#include "swift/AST/TypeRepr.h"
2425
#include "swift/AST/Types.h"
2526
#include "swift/Basic/Defer.h"
2627
#include "llvm/ADT/SmallString.h"

lib/AST/DiagnosticConsumer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "swift/AST/DiagnosticEngine.h"
2020
#include "swift/AST/DiagnosticsFrontend.h"
2121
#include "swift/Basic/Defer.h"
22+
#include "swift/Basic/Range.h"
2223
#include "swift/Basic/SourceManager.h"
2324
#include "llvm/ADT/STLExtras.h"
2425
#include "llvm/ADT/StringRef.h"

lib/AST/Pattern.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616

1717
#include "swift/AST/Pattern.h"
1818
#include "swift/AST/ASTContext.h"
19-
#include "swift/AST/Expr.h"
2019
#include "swift/AST/ASTWalker.h"
20+
#include "swift/AST/Expr.h"
2121
#include "swift/AST/GenericEnvironment.h"
2222
#include "swift/AST/TypeLoc.h"
23+
#include "swift/AST/TypeRepr.h"
2324
#include "swift/Basic/Statistic.h"
2425
#include "llvm/ADT/APFloat.h"
2526
#include "llvm/Support/raw_ostream.h"

lib/AST/PrettyStackTrace.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "swift/AST/ProtocolConformance.h"
2525
#include "swift/AST/Stmt.h"
2626
#include "swift/AST/PrettyStackTrace.h"
27+
#include "swift/AST/TypeRepr.h"
2728
#include "swift/AST/TypeVisitor.h"
2829
#include "swift/Basic/SourceManager.h"
2930
#include "llvm/Support/raw_ostream.h"

lib/ClangImporter/ImportName.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
#include "swift/AST/DiagnosticsClangImporter.h"
2626
#include "swift/AST/Module.h"
2727
#include "swift/AST/NameLookup.h"
28-
#include "swift/AST/Types.h"
2928
#include "swift/AST/TypeRepr.h"
29+
#include "swift/AST/Types.h"
3030
#include "swift/Basic/StringExtras.h"
3131
#include "swift/ClangImporter/ClangImporterOptions.h"
3232
#include "swift/Parse/Parser.h"

lib/Frontend/FrontendInputsAndOutputs.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "swift/AST/DiagnosticsFrontend.h"
1616
#include "swift/Basic/FileTypes.h"
1717
#include "swift/Basic/PrimarySpecificPaths.h"
18+
#include "swift/Basic/Range.h"
1819
#include "swift/Frontend/FrontendOptions.h"
1920
#include "swift/Option/Options.h"
2021
#include "swift/Parse/Lexer.h"

lib/Index/Index.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "swift/AST/ParameterList.h"
2121
#include "swift/AST/ProtocolConformance.h"
2222
#include "swift/AST/SourceFile.h"
23+
#include "swift/AST/TypeRepr.h"
2324
#include "swift/AST/Types.h"
2425
#include "swift/AST/USRGeneration.h"
2526
#include "swift/Basic/SourceManager.h"

lib/Parse/ASTGen.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "swift/Parse/ASTGen.h"
14+
#include "swift/AST/TypeRepr.h"
15+
#include "swift/Basic/SourceManager.h"
1416

1517
#include "swift/Basic/SourceManager.h"
1618
#include "swift/Parse/CodeCompletionCallbacks.h"

lib/Parse/ParseExpr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "swift/Parse/Parser.h"
1818
#include "swift/AST/DiagnosticsParse.h"
19+
#include "swift/AST/TypeRepr.h"
1920
#include "swift/Basic/EditorPlaceholder.h"
2021
#include "swift/Parse/CodeCompletionCallbacks.h"
2122
#include "swift/Parse/ParsedSyntaxRecorder.h"

lib/Parse/ParseGeneric.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "swift/Parse/Parser.h"
1818
#include "swift/AST/DiagnosticsParse.h"
19+
#include "swift/AST/TypeRepr.h"
1920
#include "swift/Parse/ParsedSyntaxBuilders.h"
2021
#include "swift/Parse/ParsedSyntaxRecorder.h"
2122
#include "swift/Parse/SyntaxParsingContext.h"

lib/Parse/ParsePattern.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "swift/AST/Initializer.h"
2121
#include "swift/AST/Module.h"
2222
#include "swift/AST/SourceFile.h"
23+
#include "swift/AST/TypeRepr.h"
2324
#include "swift/Basic/StringExtras.h"
2425
#include "swift/Parse/CodeCompletionCallbacks.h"
2526
#include "swift/Parse/ParsedSyntaxRecorder.h"

lib/Parse/ParseType.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "swift/AST/ASTWalker.h"
1919
#include "swift/AST/Attr.h"
2020
#include "swift/AST/TypeLoc.h"
21+
#include "swift/AST/TypeRepr.h"
2122
#include "swift/Parse/Lexer.h"
2223
#include "swift/Parse/CodeCompletionCallbacks.h"
2324
#include "swift/Parse/SyntaxParsingContext.h"

lib/RemoteAST/RemoteAST.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
#include "swift/AST/Module.h"
2727
#include "swift/AST/NameLookup.h"
2828
#include "swift/AST/SubstitutionMap.h"
29-
#include "swift/AST/Types.h"
3029
#include "swift/AST/TypeRepr.h"
30+
#include "swift/AST/Types.h"
3131
#include "swift/Basic/Mangler.h"
3232
#include "swift/ClangImporter/ClangImporter.h"
3333
#include "swift/Demangling/Demangler.h"

tools/SourceKit/lib/SwiftLang/SwiftDocSupport.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "swift/AST/ASTPrinter.h"
2222
#include "swift/AST/ASTWalker.h"
2323
#include "swift/AST/GenericSignature.h"
24+
#include "swift/AST/TypeRepr.h"
2425
#include "swift/Frontend/Frontend.h"
2526
#include "swift/Frontend/PrintingDiagnosticConsumer.h"
2627
#include "swift/IDE/CommentConversion.h"

0 commit comments

Comments
 (0)