Skip to content

Commit c86b5ae

Browse files
committed
AST: Header file gardening - include what you use
1 parent 8de0ca5 commit c86b5ae

Some content is hidden

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

51 files changed

+71
-4
lines changed

include/swift/AST/ASTContext.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "llvm/Support/DataTypes.h"
2121
#include "swift/AST/ClangModuleLoader.h"
2222
#include "swift/AST/Identifier.h"
23-
#include "swift/AST/ProtocolConformance.h"
2423
#include "swift/AST/SearchPathOptions.h"
2524
#include "swift/AST/Type.h"
2625
#include "swift/AST/TypeAlignments.h"
@@ -43,6 +42,7 @@
4342
namespace clang {
4443
class Decl;
4544
class MacroInfo;
45+
class Module;
4646
class ObjCInterfaceDecl;
4747
}
4848

@@ -58,11 +58,16 @@ namespace swift {
5858
class ForeignRepresentationInfo;
5959
class FuncDecl;
6060
class InFlightDiagnostic;
61+
class IterableDeclContext;
6162
class LazyAbstractFunctionData;
63+
class LazyGenericTypeData;
64+
class LazyContextData;
65+
class LazyMemberLoader;
6266
class LazyIterableDeclContextData;
6367
class LazyResolver;
6468
class PatternBindingDecl;
6569
class PatternBindingInitializer;
70+
class SourceFile;
6671
class SourceLoc;
6772
class Type;
6873
class TypeVariableType;
@@ -75,6 +80,12 @@ namespace swift {
7580
class ModuleDecl;
7681
class ModuleLoader;
7782
class NominalTypeDecl;
83+
class NormalProtocolConformance;
84+
class InheritedProtocolConformance;
85+
class SpecializedProtocolConformance;
86+
enum class ProtocolConformanceState;
87+
class Pattern;
88+
enum PointerTypeKind : unsigned;
7889
class PrecedenceGroupDecl;
7990
class TupleTypeElt;
8091
class EnumElementDecl;
@@ -86,8 +97,11 @@ namespace swift {
8697
class DiagnosticEngine;
8798
class Substitution;
8899
class TypeCheckerDebugConsumer;
100+
struct RawComment;
89101
class DocComment;
90102
class SILBoxType;
103+
class TypeAliasDecl;
104+
class VarDecl;
91105

92106
enum class KnownProtocolKind : uint8_t;
93107

include/swift/SIL/TypeSubstCloner.h

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

2121
#include "swift/AST/GenericEnvironment.h"
22+
#include "swift/AST/ProtocolConformance.h"
2223
#include "swift/AST/Type.h"
2324
#include "swift/SIL/SILCloner.h"
2425
#include "swift/SIL/DynamicCasts.h"

include/swift/Serialization/ModuleFile.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#ifndef SWIFT_SERIALIZATION_MODULEFILE_H
1414
#define SWIFT_SERIALIZATION_MODULEFILE_H
1515

16-
#include "swift/AST/Decl.h"
1716
#include "swift/AST/Identifier.h"
1817
#include "swift/AST/LazyResolver.h"
1918
#include "swift/AST/LinkLibrary.h"
@@ -37,6 +36,9 @@ namespace llvm {
3736
}
3837

3938
namespace swift {
39+
class Decl;
40+
class FileUnit;
41+
class ModuleDecl;
4042
class Pattern;
4143
class ProtocolConformance;
4244

lib/AST/ASTDumper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "swift/AST/GenericEnvironment.h"
2323
#include "swift/AST/Initializer.h"
2424
#include "swift/AST/ParameterList.h"
25+
#include "swift/AST/ProtocolConformance.h"
2526
#include "swift/AST/TypeVisitor.h"
2627
#include "swift/Basic/STLExtras.h"
2728
#include "llvm/ADT/APFloat.h"

lib/AST/ASTPrinter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "swift/AST/NameLookup.h"
2626
#include "swift/AST/ParameterList.h"
2727
#include "swift/AST/PrintOptions.h"
28+
#include "swift/AST/ProtocolConformance.h"
2829
#include "swift/AST/Stmt.h"
2930
#include "swift/AST/TypeVisitor.h"
3031
#include "swift/AST/TypeWalker.h"

lib/AST/ASTVerifier.cpp

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

lib/AST/ConcreteDeclRef.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "swift/AST/ASTContext.h"
1818
#include "swift/AST/ConcreteDeclRef.h"
1919
#include "swift/AST/Decl.h"
20+
#include "swift/AST/ProtocolConformance.h"
2021
#include "swift/AST/Types.h"
2122
#include "llvm/Support/raw_ostream.h"
2223
using namespace swift;

lib/AST/ConformanceLookupTable.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "swift/AST/ASTContext.h"
1919
#include "swift/AST/Decl.h"
2020
#include "swift/AST/Module.h"
21+
#include "swift/AST/ProtocolConformance.h"
2122
#include "llvm/Support/SaveAndRestore.h"
2223

2324
using namespace swift;

lib/AST/Decl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "swift/AST/LazyResolver.h"
2929
#include "swift/AST/Mangle.h"
3030
#include "swift/AST/ParameterList.h"
31+
#include "swift/AST/ProtocolConformance.h"
3132
#include "swift/AST/ResilienceExpansion.h"
3233
#include "swift/AST/TypeLoc.h"
3334
#include "clang/Lex/MacroInfo.h"

lib/AST/LookupVisibleDecls.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717

1818
#include "NameLookupImpl.h"
1919
#include "swift/AST/AST.h"
20-
#include "swift/AST/NameLookup.h"
2120
#include "swift/AST/Initializer.h"
21+
#include "swift/AST/NameLookup.h"
22+
#include "swift/AST/ProtocolConformance.h"
2223
#include "swift/Basic/SourceManager.h"
2324
#include "swift/Basic/STLExtras.h"
2425
#include "swift/Sema/IDETypeChecking.h"

lib/AST/Module.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#include "swift/AST/ReferencedNameTracker.h"
3030
#include "swift/AST/PrettyStackTrace.h"
3131
#include "swift/AST/PrintOptions.h"
32+
#include "swift/AST/ProtocolConformance.h"
33+
#include "swift/Basic/Compiler.h"
3234
#include "swift/Basic/SourceManager.h"
3335
#include "clang/Basic/Module.h"
3436
#include "llvm/ADT/DenseMap.h"

lib/AST/Parameter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "swift/AST/ParameterList.h"
1919
#include "swift/AST/ASTContext.h"
2020
#include "swift/AST/Expr.h"
21+
#include "swift/AST/Types.h"
2122
using namespace swift;
2223

2324
/// TODO: unique and reuse the () parameter list in ASTContext, it is common to

lib/AST/RawComment.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "swift/AST/Decl.h"
2222
#include "swift/AST/Module.h"
2323
#include "swift/AST/PrettyStackTrace.h"
24+
#include "swift/AST/Types.h"
2425
#include "swift/Basic/PrimitiveParsing.h"
2526
#include "swift/Basic/SourceManager.h"
2627
#include "swift/Markup/Markup.h"

lib/AST/SILLayout.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
#include "swift/AST/ASTContext.h"
2929
#include "swift/AST/SILLayout.h"
30+
#include "swift/AST/Types.h"
31+
#include "swift/Basic/Range.h"
3032

3133
using namespace swift;
3234

lib/AST/Substitution.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "swift/AST/ASTContext.h"
2020
#include "swift/AST/GenericEnvironment.h"
2121
#include "swift/AST/Module.h"
22+
#include "swift/AST/ProtocolConformance.h"
2223
#include "swift/AST/SubstitutionMap.h"
2324
#include "swift/AST/Types.h"
2425
#include "llvm/ADT/DenseMap.h"

lib/AST/TypeJoinMeet.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
//
1616
//===----------------------------------------------------------------------===//
1717
#include "swift/AST/ASTContext.h"
18+
#include "swift/AST/Decl.h"
1819
#include "swift/AST/Type.h"
1920
#include "swift/AST/Types.h"
2021
#include "llvm/ADT/SmallPtrSet.h"

lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "swift/AST/NameLookup.h"
3131
#include "swift/AST/ParameterList.h"
3232
#include "swift/AST/Pattern.h"
33+
#include "swift/AST/ProtocolConformance.h"
3334
#include "swift/AST/Stmt.h"
3435
#include "swift/AST/Types.h"
3536
#include "swift/Basic/Fallthrough.h"

lib/IDE/CodeCompletion.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "swift/AST/Initializer.h"
1919
#include "swift/AST/LazyResolver.h"
2020
#include "swift/AST/NameLookup.h"
21+
#include "swift/AST/ProtocolConformance.h"
2122
#include "swift/AST/USRGeneration.h"
2223
#include "swift/Basic/Defer.h"
2324
#include "swift/Basic/Fallthrough.h"

lib/IRGen/GenDecl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "swift/AST/Module.h"
2424
#include "swift/AST/NameLookup.h"
2525
#include "swift/AST/Pattern.h"
26+
#include "swift/AST/ProtocolConformance.h"
2627
#include "swift/AST/TypeMemberVisitor.h"
2728
#include "swift/AST/Types.h"
2829
#include "swift/Basic/Fallthrough.h"

lib/IRGen/GenExistential.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
#include "GenExistential.h"
1818

1919
#include "swift/AST/ASTContext.h"
20-
#include "swift/AST/Types.h"
2120
#include "swift/AST/Decl.h"
21+
#include "swift/AST/ProtocolConformance.h"
22+
#include "swift/AST/Types.h"
2223
#include "swift/SIL/SILValue.h"
2324
#include "swift/SIL/TypeLowering.h"
2425
#include "llvm/ADT/SmallString.h"

lib/IRGen/Linking.h

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

2222
#include "swift/AST/Types.h"
2323
#include "swift/AST/Decl.h"
24+
#include "swift/AST/ProtocolConformance.h"
2425
#include "swift/SIL/SILModule.h"
2526
#include "swift/SIL/SILFunction.h"
2627
#include "swift/SIL/SILGlobalVariable.h"

lib/IRGen/LocalTypeData.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "IRGenFunction.h"
2424
#include "IRGenModule.h"
2525
#include "swift/AST/IRGenOptions.h"
26+
#include "swift/AST/ProtocolConformance.h"
2627
#include "swift/SIL/SILModule.h"
2728

2829
using namespace swift;

lib/Parse/ParseSIL.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "swift/AST/ASTWalker.h"
1414
#include "swift/AST/GenericEnvironment.h"
1515
#include "swift/AST/NameLookup.h"
16+
#include "swift/AST/ProtocolConformance.h"
1617
#include "swift/Basic/Defer.h"
1718
#include "swift/Basic/Fallthrough.h"
1819
#include "swift/Parse/Lexer.h"

lib/PrintAsObjC/PrintAsObjC.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "swift/AST/ForeignErrorConvention.h"
1818
#include "swift/AST/NameLookup.h"
1919
#include "swift/AST/PrettyStackTrace.h"
20+
#include "swift/AST/ProtocolConformance.h"
2021
#include "swift/AST/TypeVisitor.h"
2122
#include "swift/AST/Comment.h"
2223
#include "swift/Basic/StringExtras.h"

lib/SIL/Bridging.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "swift/SIL/SILModule.h"
2121
#include "swift/AST/Decl.h"
2222
#include "swift/AST/DiagnosticsSIL.h"
23+
#include "swift/AST/ProtocolConformance.h"
2324
#include "swift/Basic/Fallthrough.h"
2425
#include "clang/AST/DeclObjC.h"
2526
#include "llvm/Support/Debug.h"

lib/SIL/InstructionUtils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "swift/SIL/InstructionUtils.h"
1515
#include "swift/Basic/NullablePtr.h"
1616
#include "swift/Basic/Fallthrough.h"
17+
#include "swift/AST/ProtocolConformance.h"
1718
#include "swift/SIL/Projection.h"
1819
#include "swift/SIL/SILArgument.h"
1920
#include "swift/SIL/SILBasicBlock.h"

lib/SIL/Linker.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "llvm/ADT/SmallString.h"
1818
#include "llvm/ADT/StringSwitch.h"
1919
#include "llvm/Support/Debug.h"
20+
#include "swift/AST/ProtocolConformance.h"
2021
#include "swift/SIL/FormalLinkage.h"
2122
#include <functional>
2223

lib/SIL/SIL.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "swift/AST/Expr.h"
2323
#include "swift/AST/Mangle.h"
2424
#include "swift/AST/Pattern.h"
25+
#include "swift/AST/ProtocolConformance.h"
2526
#include "swift/ClangImporter/ClangModule.h"
2627
#include "swift/Basic/Fallthrough.h"
2728
#include "clang/AST/Attr.h"

lib/SIL/SILInstructions.cpp

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

1717
#include "swift/SIL/SILInstruction.h"
1818
#include "swift/AST/AST.h"
19+
#include "swift/AST/ProtocolConformance.h"
1920
#include "swift/Basic/type_traits.h"
2021
#include "swift/Basic/Unicode.h"
2122
#include "swift/Basic/AssertImplements.h"

lib/SIL/SILModule.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#define DEBUG_TYPE "sil-module"
1414
#include "swift/Serialization/SerializedSILLoader.h"
1515
#include "swift/AST/GenericEnvironment.h"
16+
#include "swift/AST/ProtocolConformance.h"
1617
#include "swift/AST/Substitution.h"
1718
#include "swift/SIL/FormalLinkage.h"
1819
#include "swift/SIL/SILDebugScope.h"

lib/SIL/SILPrinter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "swift/AST/GenericEnvironment.h"
3434
#include "swift/AST/Module.h"
3535
#include "swift/AST/PrintOptions.h"
36+
#include "swift/AST/ProtocolConformance.h"
3637
#include "swift/AST/Types.h"
3738
#include "swift/Basic/STLExtras.h"
3839
#include "llvm/ADT/APFloat.h"

lib/SIL/SILVerifier.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "swift/AST/Decl.h"
2525
#include "swift/AST/GenericEnvironment.h"
2626
#include "swift/AST/Module.h"
27+
#include "swift/AST/ProtocolConformance.h"
2728
#include "swift/AST/Types.h"
2829
#include "swift/SIL/PrettyStackTrace.h"
2930
#include "swift/SIL/TypeLowering.h"

lib/SIL/SILWitnessTable.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "swift/SIL/SILWitnessTable.h"
2323
#include "swift/AST/Mangle.h"
2424
#include "swift/AST/ASTMangler.h"
25+
#include "swift/AST/ProtocolConformance.h"
2526
#include "swift/SIL/SILModule.h"
2627
#include "llvm/ADT/SmallString.h"
2728

lib/SILGen/SILGen.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "swift/AST/DiagnosticsSIL.h"
1919
#include "swift/AST/NameLookup.h"
2020
#include "swift/AST/PrettyStackTrace.h"
21+
#include "swift/AST/ProtocolConformance.h"
2122
#include "swift/AST/ResilienceExpansion.h"
2223
#include "swift/Basic/Timer.h"
2324
#include "swift/ClangImporter/ClangModule.h"

lib/SILGen/SILGenBridging.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "swift/AST/ForeignErrorConvention.h"
1919
#include "swift/AST/GenericEnvironment.h"
2020
#include "swift/AST/ParameterList.h"
21+
#include "swift/AST/ProtocolConformance.h"
2122
#include "swift/Basic/Fallthrough.h"
2223
#include "swift/SIL/SILArgument.h"
2324
#include "swift/SIL/SILUndef.h"

lib/SILGen/SILGenConvert.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "Scope.h"
1515
#include "swift/AST/ASTContext.h"
1616
#include "swift/AST/Decl.h"
17+
#include "swift/AST/ProtocolConformance.h"
1718
#include "swift/AST/Types.h"
1819
#include "swift/Basic/Fallthrough.h"
1920
#include "swift/Basic/type_traits.h"

lib/SILGen/SILGenDecl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "swift/AST/ASTMangler.h"
2929
#include "swift/AST/Module.h"
3030
#include "swift/AST/NameLookup.h"
31+
#include "swift/AST/ProtocolConformance.h"
3132
#include "swift/Basic/Fallthrough.h"
3233
#include "llvm/ADT/SmallString.h"
3334
#include <iterator>

lib/SILGen/SILGenMaterializeForSet.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "swift/AST/DiagnosticsCommon.h"
2828
#include "swift/AST/Mangle.h"
2929
#include "swift/AST/ASTMangler.h"
30+
#include "swift/AST/ProtocolConformance.h"
3031
#include "swift/SIL/PrettyStackTrace.h"
3132
#include "swift/SIL/SILArgument.h"
3233
#include "swift/SIL/SILUndef.h"

lib/SILGen/SILGenType.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "Scope.h"
2323
#include "ManagedValue.h"
2424
#include "swift/AST/AST.h"
25+
#include "swift/AST/ProtocolConformance.h"
2526
#include "swift/AST/TypeMemberVisitor.h"
2627
#include "swift/Basic/Fallthrough.h"
2728
#include "swift/SIL/SILArgument.h"

lib/SILOptimizer/IPO/DeadFunctionElimination.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#define DEBUG_TYPE "sil-dead-function-elimination"
14+
#include "swift/AST/ProtocolConformance.h"
1415
#include "swift/SILOptimizer/PassManager/Passes.h"
1516
#include "swift/SILOptimizer/PassManager/Transforms.h"
1617
#include "swift/SIL/PatternMatch.h"

lib/SILOptimizer/Utils/Devirtualize.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "swift/SILOptimizer/Analysis/ClassHierarchyAnalysis.h"
1515
#include "swift/SILOptimizer/Utils/Devirtualize.h"
1616
#include "swift/AST/Decl.h"
17+
#include "swift/AST/ProtocolConformance.h"
1718
#include "swift/AST/Types.h"
1819
#include "swift/SIL/SILDeclRef.h"
1920
#include "swift/SIL/SILFunction.h"

0 commit comments

Comments
 (0)