From 062fd6e24ffc2b270e94c8ee0d5eb03178bd5653 Mon Sep 17 00:00:00 2001 From: Hamish Knight Date: Mon, 9 Oct 2023 20:29:02 +0100 Subject: [PATCH 1/2] NFC: Remove unused include --- include/swift/AST/Decl.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/swift/AST/Decl.h b/include/swift/AST/Decl.h index 87631f3000eb9..d0ca27b5c2748 100644 --- a/include/swift/AST/Decl.h +++ b/include/swift/AST/Decl.h @@ -24,7 +24,6 @@ #include "swift/AST/ClangNode.h" #include "swift/AST/ConcreteDeclRef.h" #include "swift/AST/DefaultArgumentKind.h" -#include "swift/AST/DiagnosticConsumer.h" #include "swift/AST/DiagnosticEngine.h" #include "swift/AST/FreestandingMacroExpansion.h" #include "swift/AST/GenericParamKey.h" From ccd32eb4528bf6efbf404ea8a78a27983f7b70fe Mon Sep 17 00:00:00 2001 From: Hamish Knight Date: Mon, 9 Oct 2023 20:29:03 +0100 Subject: [PATCH 2/2] NFC: Remove ClangModuleLoader.h include from ExtInfo.h This was unnecessarily pulling in a whole bunch of Clang headers when all was needed was a forward declaration. --- include/swift/AST/ASTContext.h | 2 ++ include/swift/AST/ASTMangler.h | 1 + include/swift/AST/ASTPrinter.h | 5 +---- include/swift/AST/Decl.h | 7 +++++++ include/swift/AST/ExtInfo.h | 2 +- include/swift/AST/PropertyWrappers.h | 2 ++ include/swift/AST/Types.h | 1 + include/swift/SIL/TypeLowering.h | 1 + include/swift/SILOptimizer/Utils/InstructionDeleter.h | 1 + include/swift/Sema/CSBindings.h | 1 + lib/AST/DeclContext.cpp | 1 + lib/FrontendTool/LoadedModuleTrace.cpp | 1 + lib/IRGen/GenCall.cpp | 1 + lib/IRGen/GenClangDecl.cpp | 1 + lib/IRGen/IRGenFunction.h | 1 + lib/SILGen/SILGenThunk.cpp | 1 + lib/Sema/CSDiagnostics.cpp | 1 + lib/Sema/PreCheckExpr.cpp | 1 + lib/Sema/TypeCheckAccess.cpp | 1 + lib/Sema/TypeCheckAvailability.cpp | 1 + lib/Sema/TypeCheckDecl.cpp | 1 + 21 files changed, 29 insertions(+), 5 deletions(-) diff --git a/include/swift/AST/ASTContext.h b/include/swift/AST/ASTContext.h index ec9606d45db94..dea584a39cdbc 100644 --- a/include/swift/AST/ASTContext.h +++ b/include/swift/AST/ASTContext.h @@ -92,11 +92,13 @@ namespace swift { class LazyIterableDeclContextData; class LazyMemberLoader; struct MacroDiscriminatorContext; + class ModuleInterfaceChecker; class PatternBindingDecl; class PatternBindingInitializer; class PluginLoader; class SourceFile; class SourceLoc; + struct TemplateInstantiationError; class Type; class TypeVariableType; class TupleType; diff --git a/include/swift/AST/ASTMangler.h b/include/swift/AST/ASTMangler.h index 6e80e93d23e50..d350e1a4f7c03 100644 --- a/include/swift/AST/ASTMangler.h +++ b/include/swift/AST/ASTMangler.h @@ -22,6 +22,7 @@ namespace clang { class NamedDecl; +class TypedefType; } namespace swift { diff --git a/include/swift/AST/ASTPrinter.h b/include/swift/AST/ASTPrinter.h index 630f3123a9cc6..c62d1a4807bd1 100644 --- a/include/swift/AST/ASTPrinter.h +++ b/include/swift/AST/ASTPrinter.h @@ -18,6 +18,7 @@ #include "swift/Basic/UUID.h" #include "swift/AST/Identifier.h" #include "swift/AST/Decl.h" +#include "clang/AST/Decl.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/DenseSet.h" @@ -28,10 +29,6 @@ // ambiguities with type names, in AliasModuleNames mode. #define MODULE_DISAMBIGUATING_PREFIX "Module___" -namespace clang { -class Decl; -} - namespace swift { class Decl; class DeclContext; diff --git a/include/swift/AST/Decl.h b/include/swift/AST/Decl.h index d0ca27b5c2748..1ad437e5b9720 100644 --- a/include/swift/AST/Decl.h +++ b/include/swift/AST/Decl.h @@ -28,6 +28,7 @@ #include "swift/AST/FreestandingMacroExpansion.h" #include "swift/AST/GenericParamKey.h" #include "swift/AST/IfConfigClause.h" +#include "swift/AST/Import.h" #include "swift/AST/LayoutConstraint.h" #include "swift/AST/LifetimeAnnotation.h" #include "swift/AST/ReferenceCounting.h" @@ -42,14 +43,20 @@ #include "swift/Basic/Debug.h" #include "swift/Basic/InlineBitfield.h" #include "swift/Basic/Located.h" +#include "swift/Basic/Nullability.h" #include "swift/Basic/NullablePtr.h" #include "swift/Basic/OptionalEnum.h" #include "swift/Basic/Range.h" #include "llvm/ADT/DenseSet.h" +#include "llvm/ADT/TinyPtrVector.h" #include "llvm/Support/TrailingObjects.h" #include #include +namespace clang { +class PointerAuthQualifier; +} // end namespace clang + namespace swift { enum class AccessSemantics : unsigned char; class AccessorDecl; diff --git a/include/swift/AST/ExtInfo.h b/include/swift/AST/ExtInfo.h index fb196dbb2c46b..472a9f546fe6a 100644 --- a/include/swift/AST/ExtInfo.h +++ b/include/swift/AST/ExtInfo.h @@ -21,7 +21,6 @@ #define SWIFT_EXTINFO_H #include "swift/AST/AutoDiff.h" -#include "swift/AST/ClangModuleLoader.h" #include "llvm/ADT/None.h" #include "llvm/ADT/Optional.h" @@ -38,6 +37,7 @@ namespace swift { class AnyFunctionType; class ASTExtInfo; class ASTExtInfoBuilder; +class ClangModuleLoader; class FunctionType; class SILExtInfo; class SILExtInfoBuilder; diff --git a/include/swift/AST/PropertyWrappers.h b/include/swift/AST/PropertyWrappers.h index 7ee6af8168880..e581f1d315004 100644 --- a/include/swift/AST/PropertyWrappers.h +++ b/include/swift/AST/PropertyWrappers.h @@ -28,6 +28,8 @@ class CustomAttr; class Expr; class VarDecl; class OpaqueValueExpr; +class PropertyWrapperValuePlaceholderExpr; +class SubscriptDecl; /// The kind of property initializer to look for enum class PropertyWrapperInitKind { diff --git a/include/swift/AST/Types.h b/include/swift/AST/Types.h index 80f3811f9d911..aaaa5daabc78a 100644 --- a/include/swift/AST/Types.h +++ b/include/swift/AST/Types.h @@ -37,6 +37,7 @@ #include "swift/Basic/UUID.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMapInfo.h" +#include "llvm/ADT/DenseSet.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/None.h" #include "llvm/ADT/Optional.h" diff --git a/include/swift/SIL/TypeLowering.h b/include/swift/SIL/TypeLowering.h index f759751c1f2ca..2bba58f37acf8 100644 --- a/include/swift/SIL/TypeLowering.h +++ b/include/swift/SIL/TypeLowering.h @@ -23,6 +23,7 @@ #include "swift/SIL/SILValue.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/Hashing.h" +#include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Allocator.h" diff --git a/include/swift/SILOptimizer/Utils/InstructionDeleter.h b/include/swift/SILOptimizer/Utils/InstructionDeleter.h index 9cda730d23d4d..86dfd15c4b6bd 100644 --- a/include/swift/SILOptimizer/Utils/InstructionDeleter.h +++ b/include/swift/SILOptimizer/Utils/InstructionDeleter.h @@ -97,6 +97,7 @@ #include "swift/SIL/SILInstruction.h" #include "swift/SILOptimizer/Utils/InstModCallbacks.h" +#include "llvm/ADT/SetVector.h" namespace swift { diff --git a/include/swift/Sema/CSBindings.h b/include/swift/Sema/CSBindings.h index a41194401b266..8eae86f44cba2 100644 --- a/include/swift/Sema/CSBindings.h +++ b/include/swift/Sema/CSBindings.h @@ -39,6 +39,7 @@ namespace swift { class DeclContext; +enum class KnownProtocolKind : uint8_t; class ProtocolDecl; namespace constraints { diff --git a/lib/AST/DeclContext.cpp b/lib/AST/DeclContext.cpp index 7d05fa67d2b83..8d144a93e2443 100644 --- a/lib/AST/DeclContext.cpp +++ b/lib/AST/DeclContext.cpp @@ -14,6 +14,7 @@ #include "swift/AST/AccessScope.h" #include "swift/AST/ASTContext.h" #include "swift/AST/ASTWalker.h" +#include "swift/AST/ClangModuleLoader.h" #include "swift/AST/Expr.h" #include "swift/AST/FileUnit.h" #include "swift/AST/GenericEnvironment.h" diff --git a/lib/FrontendTool/LoadedModuleTrace.cpp b/lib/FrontendTool/LoadedModuleTrace.cpp index f75236c65c155..a3072be9ed35d 100644 --- a/lib/FrontendTool/LoadedModuleTrace.cpp +++ b/lib/FrontendTool/LoadedModuleTrace.cpp @@ -15,6 +15,7 @@ #include "swift/AST/DiagnosticEngine.h" #include "swift/AST/DiagnosticsFrontend.h" #include "swift/AST/Module.h" +#include "swift/AST/ModuleLoader.h" #include "swift/AST/PluginRegistry.h" #include "swift/Basic/FileTypes.h" #include "swift/Basic/JSONSerialization.h" diff --git a/lib/IRGen/GenCall.cpp b/lib/IRGen/GenCall.cpp index 256c8f038b0fa..d0ce147eb4958 100644 --- a/lib/IRGen/GenCall.cpp +++ b/lib/IRGen/GenCall.cpp @@ -18,6 +18,7 @@ #include "swift/ABI/MetadataValues.h" #include "swift/AST/ASTContext.h" +#include "swift/AST/ClangModuleLoader.h" #include "swift/AST/GenericEnvironment.h" #include "swift/IRGen/Linking.h" #include "swift/Runtime/Config.h" diff --git a/lib/IRGen/GenClangDecl.cpp b/lib/IRGen/GenClangDecl.cpp index 639830e106982..a1e182db38d6b 100644 --- a/lib/IRGen/GenClangDecl.cpp +++ b/lib/IRGen/GenClangDecl.cpp @@ -12,6 +12,7 @@ #include "IRGenModule.h" #include "swift/AST/ASTContext.h" +#include "swift/AST/ClangModuleLoader.h" #include "swift/AST/IRGenOptions.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclCXX.h" diff --git a/lib/IRGen/IRGenFunction.h b/lib/IRGen/IRGenFunction.h index c2ff49fd352b2..da0e73853e0a4 100644 --- a/lib/IRGen/IRGenFunction.h +++ b/lib/IRGen/IRGenFunction.h @@ -28,6 +28,7 @@ #include "swift/SIL/SILLocation.h" #include "swift/SIL/SILType.h" #include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/SetVector.h" #include "llvm/IR/CallingConv.h" namespace llvm { diff --git a/lib/SILGen/SILGenThunk.cpp b/lib/SILGen/SILGenThunk.cpp index 1f51472781e9a..9846c4c5cbc58 100644 --- a/lib/SILGen/SILGenThunk.cpp +++ b/lib/SILGen/SILGenThunk.cpp @@ -26,6 +26,7 @@ #include "SILGenFunctionBuilder.h" #include "Scope.h" #include "swift/AST/ASTMangler.h" +#include "swift/AST/ClangModuleLoader.h" #include "swift/AST/DiagnosticsSIL.h" #include "swift/AST/FileUnit.h" #include "swift/AST/ForeignAsyncConvention.h" diff --git a/lib/Sema/CSDiagnostics.cpp b/lib/Sema/CSDiagnostics.cpp index e9292a745939e..959bf09e49ac2 100644 --- a/lib/Sema/CSDiagnostics.cpp +++ b/lib/Sema/CSDiagnostics.cpp @@ -20,6 +20,7 @@ #include "TypoCorrection.h" #include "swift/AST/ASTContext.h" #include "swift/AST/ASTPrinter.h" +#include "swift/AST/ClangModuleLoader.h" #include "swift/AST/Decl.h" #include "swift/AST/DiagnosticsClangImporter.h" #include "swift/AST/ExistentialLayout.h" diff --git a/lib/Sema/PreCheckExpr.cpp b/lib/Sema/PreCheckExpr.cpp index f55f72caf8aca..fe189ed3886f1 100644 --- a/lib/Sema/PreCheckExpr.cpp +++ b/lib/Sema/PreCheckExpr.cpp @@ -20,6 +20,7 @@ #include "TypoCorrection.h" #include "swift/AST/ASTVisitor.h" #include "swift/AST/ASTWalker.h" +#include "swift/AST/ClangModuleLoader.h" #include "swift/AST/DiagnosticsParse.h" #include "swift/AST/GenericEnvironment.h" #include "swift/AST/NameLookup.h" diff --git a/lib/Sema/TypeCheckAccess.cpp b/lib/Sema/TypeCheckAccess.cpp index 8f9d0b03a2310..7463d61359c65 100644 --- a/lib/Sema/TypeCheckAccess.cpp +++ b/lib/Sema/TypeCheckAccess.cpp @@ -20,6 +20,7 @@ #include "TypeAccessScopeChecker.h" #include "swift/AST/ASTVisitor.h" #include "swift/AST/ASTWalker.h" +#include "swift/AST/ClangModuleLoader.h" #include "swift/AST/DiagnosticsSema.h" #include "swift/AST/ExistentialLayout.h" #include "swift/AST/Import.h" diff --git a/lib/Sema/TypeCheckAvailability.cpp b/lib/Sema/TypeCheckAvailability.cpp index 174cab91f875f..40268bfbc76c8 100644 --- a/lib/Sema/TypeCheckAvailability.cpp +++ b/lib/Sema/TypeCheckAvailability.cpp @@ -20,6 +20,7 @@ #include "TypeCheckObjC.h" #include "TypeChecker.h" #include "swift/AST/ASTWalker.h" +#include "swift/AST/ClangModuleLoader.h" #include "swift/AST/GenericEnvironment.h" #include "swift/AST/Initializer.h" #include "swift/AST/NameLookup.h" diff --git a/lib/Sema/TypeCheckDecl.cpp b/lib/Sema/TypeCheckDecl.cpp index 3c609b1ced177..eb2afeb4babaf 100644 --- a/lib/Sema/TypeCheckDecl.cpp +++ b/lib/Sema/TypeCheckDecl.cpp @@ -29,6 +29,7 @@ #include "swift/AST/ASTWalker.h" #include "swift/AST/AccessScope.h" #include "swift/AST/Attr.h" +#include "swift/AST/ClangModuleLoader.h" #include "swift/AST/ExistentialLayout.h" #include "swift/AST/Expr.h" #include "swift/AST/ForeignErrorConvention.h"