summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-01-09 12:21:00 -0800
committerKazu Hirata <kazu@google.com>2022-01-09 12:21:00 -0800
commitac2090d507a67d1e98594d081ce3951837d43f28 (patch)
tree0830f7365578f266d54d7947a3a3c616803ab968
parent39ea676d9d0ea467b7e5fe2d5c25d22a2d906041 (diff)
downloadllvm-ac2090d507a67d1e98594d081ce3951837d43f28.tar.gz
[clang] Remove unused forward declarations (NFC)
-rw-r--r--clang/include/clang/AST/ASTConcept.h1
-rw-r--r--clang/include/clang/AST/ASTContext.h3
-rw-r--r--clang/include/clang/AST/ASTImporterLookupTable.h1
-rw-r--r--clang/include/clang/AST/Attr.h5
-rw-r--r--clang/include/clang/AST/AttrIterator.h1
-rw-r--r--clang/include/clang/AST/Decl.h2
-rw-r--r--clang/include/clang/AST/DeclBase.h6
-rw-r--r--clang/include/clang/AST/DeclCXX.h1
-rw-r--r--clang/include/clang/AST/DeclarationName.h2
-rw-r--r--clang/include/clang/AST/MangleNumberingContext.h2
-rw-r--r--clang/include/clang/AST/PrettyDeclStackTrace.h1
-rw-r--r--clang/include/clang/AST/PrettyPrinter.h2
-rw-r--r--clang/include/clang/AST/TemplateBase.h1
-rw-r--r--clang/include/clang/AST/TemplateName.h2
-rw-r--r--clang/include/clang/Analysis/Analyses/CalledOnceCheck.h1
-rw-r--r--clang/include/clang/Analysis/BodyFarm.h1
-rw-r--r--clang/include/clang/Analysis/PathDiagnostic.h2
-rw-r--r--clang/include/clang/Analysis/ProgramPoint.h1
-rw-r--r--clang/include/clang/Basic/PartialDiagnostic.h3
-rw-r--r--clang/include/clang/Basic/ProfileList.h4
-rw-r--r--clang/include/clang/Basic/TargetInfo.h3
-rw-r--r--clang/include/clang/CodeGen/CodeGenABITypes.h8
-rw-r--r--clang/include/clang/CodeGen/SwiftCallingConv.h1
-rw-r--r--clang/include/clang/Driver/Util.h1
-rw-r--r--clang/include/clang/Format/Format.h5
-rw-r--r--clang/include/clang/Frontend/ASTConsumers.h6
-rw-r--r--clang/include/clang/Frontend/CompilerInstance.h2
-rw-r--r--clang/include/clang/Frontend/FrontendActions.h3
-rw-r--r--clang/include/clang/Frontend/SerializedDiagnosticPrinter.h1
-rw-r--r--clang/include/clang/Interpreter/Interpreter.h2
-rw-r--r--clang/include/clang/Sema/AnalysisBasedWarnings.h2
-rw-r--r--clang/include/clang/Sema/ExternalSemaSource.h2
-rw-r--r--clang/include/clang/Sema/Initialization.h1
-rw-r--r--clang/include/clang/Sema/ScopeInfo.h1
-rw-r--r--clang/include/clang/Serialization/ASTReader.h2
-rw-r--r--clang/include/clang/Serialization/ASTWriter.h16
-rw-r--r--clang/include/clang/Serialization/GlobalModuleIndex.h2
-rw-r--r--clang/include/clang/Serialization/PCHContainerOperations.h2
-rw-r--r--clang/include/clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h4
-rw-r--r--clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h2
-rw-r--r--clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h2
-rw-r--r--clang/include/clang/StaticAnalyzer/Core/CheckerManager.h1
-rw-r--r--clang/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h1
-rw-r--r--clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h1
-rw-r--r--clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h1
-rw-r--r--clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h1
-rw-r--r--clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h4
-rw-r--r--clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h1
-rw-r--r--clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h2
-rw-r--r--clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h1
-rw-r--r--clang/include/clang/StaticAnalyzer/Frontend/AnalysisConsumer.h4
-rw-r--r--clang/include/clang/StaticAnalyzer/Frontend/FrontendActions.h3
-rw-r--r--clang/include/clang/Tooling/ASTDiff/ASTDiffInternal.h1
-rw-r--r--clang/include/clang/Tooling/Refactoring/Rename/RenamingAction.h1
-rw-r--r--clang/include/clang/Tooling/Refactoring/Rename/USRFindingAction.h1
-rw-r--r--clang/include/clang/Tooling/Tooling.h1
-rw-r--r--clang/tools/libclang/CXType.h3
57 files changed, 0 insertions, 137 deletions
diff --git a/clang/include/clang/AST/ASTConcept.h b/clang/include/clang/AST/ASTConcept.h
index c8a1dc83b8aa..25e00860060f 100644
--- a/clang/include/clang/AST/ASTConcept.h
+++ b/clang/include/clang/AST/ASTConcept.h
@@ -22,7 +22,6 @@
namespace clang {
class ConceptDecl;
-class ConceptSpecializationExpr;
/// The result of a constraint satisfaction check, containing the necessary
/// information to diagnose an unsatisfied constraint.
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h
index 63f2c948c79b..7a9e3a643d6f 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -104,10 +104,8 @@ class DynTypedNodeList;
class Expr;
enum class FloatModeKind;
class GlobalDecl;
-class ItaniumMangleContext;
class MangleContext;
class MangleNumberingContext;
-class MaterializeTemporaryExpr;
class MemberSpecializationInfo;
class Module;
struct MSGuidDeclParts;
@@ -126,7 +124,6 @@ class ObjCTypeParamDecl;
class OMPTraitInfo;
struct ParsedTargetAttr;
class Preprocessor;
-class Stmt;
class StoredDeclsMap;
class TargetAttr;
class TargetInfo;
diff --git a/clang/include/clang/AST/ASTImporterLookupTable.h b/clang/include/clang/AST/ASTImporterLookupTable.h
index 918c2b9e350c..2dbc44c5dcd4 100644
--- a/clang/include/clang/AST/ASTImporterLookupTable.h
+++ b/clang/include/clang/AST/ASTImporterLookupTable.h
@@ -21,7 +21,6 @@
namespace clang {
-class ASTContext;
class NamedDecl;
class DeclContext;
diff --git a/clang/include/clang/AST/Attr.h b/clang/include/clang/AST/Attr.h
index 6366d6e8837e..070e160d6517 100644
--- a/clang/include/clang/AST/Attr.h
+++ b/clang/include/clang/AST/Attr.h
@@ -34,12 +34,7 @@
namespace clang {
class ASTContext;
class AttributeCommonInfo;
-class IdentifierInfo;
-class ObjCInterfaceDecl;
-class Expr;
-class QualType;
class FunctionDecl;
-class TypeSourceInfo;
class OMPTraitInfo;
/// Attr - This represents one attribute.
diff --git a/clang/include/clang/AST/AttrIterator.h b/clang/include/clang/AST/AttrIterator.h
index 78ce9314a2bb..66571e1cf0b8 100644
--- a/clang/include/clang/AST/AttrIterator.h
+++ b/clang/include/clang/AST/AttrIterator.h
@@ -22,7 +22,6 @@
namespace clang {
-class ASTContext;
class Attr;
/// AttrVec - A vector of Attr, which is how they are stored on the AST.
diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index 2eacf1105c18..862e8899d275 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -53,7 +53,6 @@ namespace clang {
class ASTContext;
struct ASTTemplateArgumentListInfo;
-class Attr;
class CompoundStmt;
class DependentFunctionTemplateSpecializationInfo;
class EnumDecl;
@@ -74,7 +73,6 @@ class TemplateArgumentList;
class TemplateArgumentListInfo;
class TemplateParameterList;
class TypeAliasTemplateDecl;
-class TypeLoc;
class UnresolvedSetImpl;
class VarTemplateDecl;
diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h
index 2a0a19597391..1328d377d00f 100644
--- a/clang/include/clang/AST/DeclBase.h
+++ b/clang/include/clang/AST/DeclBase.h
@@ -52,14 +52,8 @@ enum Linkage : unsigned char;
class LinkageSpecDecl;
class Module;
class NamedDecl;
-class ObjCCategoryDecl;
-class ObjCCategoryImplDecl;
class ObjCContainerDecl;
-class ObjCImplDecl;
-class ObjCImplementationDecl;
-class ObjCInterfaceDecl;
class ObjCMethodDecl;
-class ObjCProtocolDecl;
struct PrintingPolicy;
class RecordDecl;
class SourceManager;
diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h
index 309a60f43e4f..b54e6b0ac217 100644
--- a/clang/include/clang/AST/DeclCXX.h
+++ b/clang/include/clang/AST/DeclCXX.h
@@ -64,7 +64,6 @@ class CXXFinalOverriderMap;
class CXXIndirectPrimaryBaseSet;
class CXXMethodDecl;
class DecompositionDecl;
-class DiagnosticBuilder;
class FriendDecl;
class FunctionTemplateDecl;
class IdentifierInfo;
diff --git a/clang/include/clang/AST/DeclarationName.h b/clang/include/clang/AST/DeclarationName.h
index 38da6fc727fb..0762e0a478ea 100644
--- a/clang/include/clang/AST/DeclarationName.h
+++ b/clang/include/clang/AST/DeclarationName.h
@@ -34,11 +34,9 @@ class ASTContext;
template <typename> class CanQual;
class DeclarationName;
class DeclarationNameTable;
-class MultiKeywordSelector;
struct PrintingPolicy;
class TemplateDecl;
class TypeSourceInfo;
-class UsingDirectiveDecl;
using CanQualType = CanQual<Type>;
diff --git a/clang/include/clang/AST/MangleNumberingContext.h b/clang/include/clang/AST/MangleNumberingContext.h
index eb33759682d6..a4a6ce4c2708 100644
--- a/clang/include/clang/AST/MangleNumberingContext.h
+++ b/clang/include/clang/AST/MangleNumberingContext.h
@@ -21,9 +21,7 @@ namespace clang {
class BlockDecl;
class CXXMethodDecl;
-class IdentifierInfo;
class TagDecl;
-class Type;
class VarDecl;
/// Keeps track of the mangled names of lambda expressions and block
diff --git a/clang/include/clang/AST/PrettyDeclStackTrace.h b/clang/include/clang/AST/PrettyDeclStackTrace.h
index 899bbcb3be45..82df031d4126 100644
--- a/clang/include/clang/AST/PrettyDeclStackTrace.h
+++ b/clang/include/clang/AST/PrettyDeclStackTrace.h
@@ -22,7 +22,6 @@ namespace clang {
class ASTContext;
class Decl;
-class SourceManager;
/// PrettyDeclStackTraceEntry - If a crash occurs in the parser while
/// parsing something related to a declaration, include that
diff --git a/clang/include/clang/AST/PrettyPrinter.h b/clang/include/clang/AST/PrettyPrinter.h
index f6816e938f2a..01dc8e000270 100644
--- a/clang/include/clang/AST/PrettyPrinter.h
+++ b/clang/include/clang/AST/PrettyPrinter.h
@@ -20,9 +20,7 @@ namespace clang {
class DeclContext;
class LangOptions;
-class SourceManager;
class Stmt;
-class TagDecl;
class PrinterHelper {
public:
diff --git a/clang/include/clang/AST/TemplateBase.h b/clang/include/clang/AST/TemplateBase.h
index fa27a12cfbb9..e8064121d279 100644
--- a/clang/include/clang/AST/TemplateBase.h
+++ b/clang/include/clang/AST/TemplateBase.h
@@ -52,7 +52,6 @@ template <> struct PointerLikeTypeTraits<clang::Expr *> {
namespace clang {
class ASTContext;
-class DiagnosticBuilder;
class Expr;
struct PrintingPolicy;
class TypeSourceInfo;
diff --git a/clang/include/clang/AST/TemplateName.h b/clang/include/clang/AST/TemplateName.h
index 2befb5c1b45e..44080a7f56d4 100644
--- a/clang/include/clang/AST/TemplateName.h
+++ b/clang/include/clang/AST/TemplateName.h
@@ -26,14 +26,12 @@ namespace clang {
class ASTContext;
class DependentTemplateName;
-class DiagnosticBuilder;
class IdentifierInfo;
class NamedDecl;
class NestedNameSpecifier;
enum OverloadedOperatorKind : int;
class OverloadedTemplateStorage;
class AssumedTemplateStorage;
-class PartialDiagnostic;
struct PrintingPolicy;
class QualifiedTemplateName;
class SubstTemplateTemplateParmPackStorage;
diff --git a/clang/include/clang/Analysis/Analyses/CalledOnceCheck.h b/clang/include/clang/Analysis/Analyses/CalledOnceCheck.h
index a0c767bf92d2..6d78fa4a897a 100644
--- a/clang/include/clang/Analysis/Analyses/CalledOnceCheck.h
+++ b/clang/include/clang/Analysis/Analyses/CalledOnceCheck.h
@@ -20,7 +20,6 @@ class AnalysisDeclContext;
class BlockDecl;
class CFG;
class Decl;
-class DeclContext;
class Expr;
class ParmVarDecl;
class Stmt;
diff --git a/clang/include/clang/Analysis/BodyFarm.h b/clang/include/clang/Analysis/BodyFarm.h
index 3863cc204d6c..d947ac070209 100644
--- a/clang/include/clang/Analysis/BodyFarm.h
+++ b/clang/include/clang/Analysis/BodyFarm.h
@@ -24,7 +24,6 @@ namespace clang {
class ASTContext;
class FunctionDecl;
class ObjCMethodDecl;
-class ObjCPropertyDecl;
class Stmt;
class CodeInjector;
diff --git a/clang/include/clang/Analysis/PathDiagnostic.h b/clang/include/clang/Analysis/PathDiagnostic.h
index 553708d9ec0c..446f67b23e75 100644
--- a/clang/include/clang/Analysis/PathDiagnostic.h
+++ b/clang/include/clang/Analysis/PathDiagnostic.h
@@ -41,10 +41,8 @@ class AnalysisDeclContext;
class BinaryOperator;
class CallEnter;
class CallExitEnd;
-class CallExpr;
class ConditionalOperator;
class Decl;
-class Expr;
class LocationContext;
class MemberExpr;
class ProgramPoint;
diff --git a/clang/include/clang/Analysis/ProgramPoint.h b/clang/include/clang/Analysis/ProgramPoint.h
index 546224bfd58d..680713a52f2f 100644
--- a/clang/include/clang/Analysis/ProgramPoint.h
+++ b/clang/include/clang/Analysis/ProgramPoint.h
@@ -30,7 +30,6 @@
namespace clang {
class AnalysisDeclContext;
-class FunctionDecl;
class LocationContext;
/// ProgramPoints can be "tagged" as representing points specific to a given
diff --git a/clang/include/clang/Basic/PartialDiagnostic.h b/clang/include/clang/Basic/PartialDiagnostic.h
index 217441979869..d2135f5da0bd 100644
--- a/clang/include/clang/Basic/PartialDiagnostic.h
+++ b/clang/include/clang/Basic/PartialDiagnostic.h
@@ -28,9 +28,6 @@
namespace clang {
-class DeclContext;
-class IdentifierInfo;
-
class PartialDiagnostic : public StreamingDiagnostic {
private:
// NOTE: Sema assumes that PartialDiagnostic is location-invariant
diff --git a/clang/include/clang/Basic/ProfileList.h b/clang/include/clang/Basic/ProfileList.h
index 5b71928eb9d0..aa472f126818 100644
--- a/clang/include/clang/Basic/ProfileList.h
+++ b/clang/include/clang/Basic/ProfileList.h
@@ -21,10 +21,6 @@
#include "llvm/ADT/StringRef.h"
#include <memory>
-namespace llvm {
-class SpecialCaseList;
-}
-
namespace clang {
class ProfileSpecialCaseList;
diff --git a/clang/include/clang/Basic/TargetInfo.h b/clang/include/clang/Basic/TargetInfo.h
index 437feba85e23..46eb190333aa 100644
--- a/clang/include/clang/Basic/TargetInfo.h
+++ b/clang/include/clang/Basic/TargetInfo.h
@@ -47,9 +47,6 @@ class DiagnosticsEngine;
class LangOptions;
class CodeGenOptions;
class MacroBuilder;
-class QualType;
-class SourceLocation;
-class SourceManager;
namespace Builtin { struct Info; }
diff --git a/clang/include/clang/CodeGen/CodeGenABITypes.h b/clang/include/clang/CodeGen/CodeGenABITypes.h
index 3c745fadbe78..fda0855dc868 100644
--- a/clang/include/clang/CodeGen/CodeGenABITypes.h
+++ b/clang/include/clang/CodeGen/CodeGenABITypes.h
@@ -32,26 +32,18 @@
namespace llvm {
class AttrBuilder;
class Constant;
-class DataLayout;
-class Module;
class Function;
class FunctionType;
class Type;
}
namespace clang {
-class ASTContext;
class CXXConstructorDecl;
class CXXDestructorDecl;
class CXXRecordDecl;
class CXXMethodDecl;
-class CodeGenOptions;
-class CoverageSourceInfo;
-class DiagnosticsEngine;
-class HeaderSearchOptions;
class ObjCMethodDecl;
class ObjCProtocolDecl;
-class PreprocessorOptions;
namespace CodeGen {
class CGFunctionInfo;
diff --git a/clang/include/clang/CodeGen/SwiftCallingConv.h b/clang/include/clang/CodeGen/SwiftCallingConv.h
index b1a638a58a09..d7a0c84699ab 100644
--- a/clang/include/clang/CodeGen/SwiftCallingConv.h
+++ b/clang/include/clang/CodeGen/SwiftCallingConv.h
@@ -28,7 +28,6 @@ namespace llvm {
}
namespace clang {
-class Decl;
class FieldDecl;
class ASTRecordLayout;
diff --git a/clang/include/clang/Driver/Util.h b/clang/include/clang/Driver/Util.h
index 6788420912a1..92d3d40433a3 100644
--- a/clang/include/clang/Driver/Util.h
+++ b/clang/include/clang/Driver/Util.h
@@ -13,7 +13,6 @@
#include "llvm/ADT/DenseMap.h"
namespace clang {
-class DiagnosticsEngine;
namespace driver {
class Action;
diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h
index 2ee6e26bde55..fe35b4bd69c9 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -29,11 +29,6 @@ class FileSystem;
} // namespace llvm
namespace clang {
-
-class Lexer;
-class SourceManager;
-class DiagnosticConsumer;
-
namespace format {
enum class ParseError {
diff --git a/clang/include/clang/Frontend/ASTConsumers.h b/clang/include/clang/Frontend/ASTConsumers.h
index 98cfc7cadc0d..0e068bf5cccb 100644
--- a/clang/include/clang/Frontend/ASTConsumers.h
+++ b/clang/include/clang/Frontend/ASTConsumers.h
@@ -20,12 +20,6 @@
namespace clang {
class ASTConsumer;
-class CodeGenOptions;
-class DiagnosticsEngine;
-class FileManager;
-class LangOptions;
-class Preprocessor;
-class TargetOptions;
// AST pretty-printer: prints out the AST in a format that is close to the
// original C code. The output is intended to be in a format such that
diff --git a/clang/include/clang/Frontend/CompilerInstance.h b/clang/include/clang/Frontend/CompilerInstance.h
index 74e152ea5952..577daad86b20 100644
--- a/clang/include/clang/Frontend/CompilerInstance.h
+++ b/clang/include/clang/Frontend/CompilerInstance.h
@@ -41,8 +41,6 @@ class ASTReader;
class CodeCompleteConsumer;
class DiagnosticsEngine;
class DiagnosticConsumer;
-class ExternalASTSource;
-class FileEntry;
class FileManager;
class FrontendAction;
class InMemoryModuleCache;
diff --git a/clang/include/clang/Frontend/FrontendActions.h b/clang/include/clang/Frontend/FrontendActions.h
index 545a7e842c4f..8bd6509559f7 100644
--- a/clang/include/clang/Frontend/FrontendActions.h
+++ b/clang/include/clang/Frontend/FrontendActions.h
@@ -15,9 +15,6 @@
namespace clang {
-class Module;
-class FileEntry;
-
//===----------------------------------------------------------------------===//
// Custom Consumer Actions
//===----------------------------------------------------------------------===//
diff --git a/clang/include/clang/Frontend/SerializedDiagnosticPrinter.h b/clang/include/clang/Frontend/SerializedDiagnosticPrinter.h
index 58954dc6bafa..5586ef65e393 100644
--- a/clang/include/clang/Frontend/SerializedDiagnosticPrinter.h
+++ b/clang/include/clang/Frontend/SerializedDiagnosticPrinter.h
@@ -19,7 +19,6 @@ class raw_ostream;
namespace clang {
class DiagnosticConsumer;
-class DiagnosticsEngine;
class DiagnosticOptions;
namespace serialized_diags {
diff --git a/clang/include/clang/Interpreter/Interpreter.h b/clang/include/clang/Interpreter/Interpreter.h
index 2dc0fd5963a2..721a649deb43 100644
--- a/clang/include/clang/Interpreter/Interpreter.h
+++ b/clang/include/clang/Interpreter/Interpreter.h
@@ -28,13 +28,11 @@ namespace llvm {
namespace orc {
class ThreadSafeContext;
}
-class Module;
} // namespace llvm
namespace clang {
class CompilerInstance;
-class DeclGroupRef;
class IncrementalExecutor;
class IncrementalParser;
diff --git a/clang/include/clang/Sema/AnalysisBasedWarnings.h b/clang/include/clang/Sema/AnalysisBasedWarnings.h
index 49b69c585ff7..13a88bb9f896 100644
--- a/clang/include/clang/Sema/AnalysisBasedWarnings.h
+++ b/clang/include/clang/Sema/AnalysisBasedWarnings.h
@@ -18,10 +18,8 @@
namespace clang {
-class BlockExpr;
class Decl;
class FunctionDecl;
-class ObjCMethodDecl;
class QualType;
class Sema;
namespace sema {
diff --git a/clang/include/clang/Sema/ExternalSemaSource.h b/clang/include/clang/Sema/ExternalSemaSource.h
index 9c18aa1398d3..17a7ffd3bb68 100644
--- a/clang/include/clang/Sema/ExternalSemaSource.h
+++ b/clang/include/clang/Sema/ExternalSemaSource.h
@@ -26,11 +26,9 @@ template <class T, unsigned n> class SmallSetVector;
namespace clang {
class CXXConstructorDecl;
-class CXXDeleteExpr;
class CXXRecordDecl;
class DeclaratorDecl;
class LookupResult;
-struct ObjCMethodList;
class Scope;
class Sema;
class TypedefNameDecl;
diff --git a/clang/include/clang/Sema/Initialization.h b/clang/include/clang/Sema/Initialization.h
index 679e12ee22d4..21adc9fa2ac0 100644
--- a/clang/include/clang/Sema/Initialization.h
+++ b/clang/include/clang/Sema/Initialization.h
@@ -38,7 +38,6 @@
namespace clang {
-class APValue;
class CXXBaseSpecifier;
class CXXConstructorDecl;
class ObjCMethodDecl;
diff --git a/clang/include/clang/Sema/ScopeInfo.h b/clang/include/clang/Sema/ScopeInfo.h
index ccd15ea6a818..08bf53d22f8a 100644
--- a/clang/include/clang/Sema/ScopeInfo.h
+++ b/clang/include/clang/Sema/ScopeInfo.h
@@ -58,7 +58,6 @@ class Scope;
class Stmt;
class SwitchStmt;
class TemplateParameterList;
-class TemplateTypeParmDecl;
class VarDecl;
namespace sema {
diff --git a/clang/include/clang/Serialization/ASTReader.h b/clang/include/clang/Serialization/ASTReader.h
index f24ccf579aa8..a36c8ba20a10 100644
--- a/clang/include/clang/Serialization/ASTReader.h
+++ b/clang/include/clang/Serialization/ASTReader.h
@@ -84,7 +84,6 @@ class GlobalModuleIndex;
struct HeaderFileInfo;
class HeaderSearchOptions;
class LangOptions;
-class LazyASTUnresolvedSet;
class MacroInfo;
class InMemoryModuleCache;
class NamedDecl;
@@ -94,7 +93,6 @@ class ObjCInterfaceDecl;
class PCHContainerReader;
class Preprocessor;
class PreprocessorOptions;
-struct QualifierInfo;
class Sema;
class SourceManager;
class Stmt;
diff --git a/clang/include/clang/Serialization/ASTWriter.h b/clang/include/clang/Serialization/ASTWriter.h
index 978f6d86ea5c..27a8770d7f26 100644
--- a/clang/include/clang/Serialization/ASTWriter.h
+++ b/clang/include/clang/Serialization/ASTWriter.h
@@ -43,26 +43,13 @@
#include <utility>
#include <vector>
-namespace llvm {
-
-class APFloat;
-class APInt;
-class APSInt;
-
-} // namespace llvm
-
namespace clang {
class ASTContext;
class ASTReader;
-class ASTUnresolvedSet;
class Attr;
-class CXXBaseSpecifier;
-class CXXCtorInitializer;
class CXXRecordDecl;
-class CXXTemporary;
class FileEntry;
-class FPOptions;
class FPOptionsOverride;
class FunctionDecl;
class HeaderSearch;
@@ -79,16 +66,13 @@ class NamedDecl;
class ObjCInterfaceDecl;
class PreprocessingRecord;
class Preprocessor;
-struct QualifierInfo;
class RecordDecl;
class Sema;
class SourceManager;
class Stmt;
class StoredDeclsList;
class SwitchCase;
-class TemplateParameterList;
class Token;
-class TypeSourceInfo;
/// Writes an AST file containing the contents of a translation unit.
///
diff --git a/clang/include/clang/Serialization/GlobalModuleIndex.h b/clang/include/clang/Serialization/GlobalModuleIndex.h
index 5f4812626224..9d6b52a97f52 100644
--- a/clang/include/clang/Serialization/GlobalModuleIndex.h
+++ b/clang/include/clang/Serialization/GlobalModuleIndex.h
@@ -31,8 +31,6 @@ class MemoryBuffer;
namespace clang {
-class DirectoryEntry;
-class FileEntry;
class FileManager;
class IdentifierIterator;
class PCHContainerOperations;
diff --git a/clang/include/clang/Serialization/PCHContainerOperations.h b/clang/include/clang/Serialization/PCHContainerOperations.h
index 33fc4a0a24e0..9f9700a418a9 100644
--- a/clang/include/clang/Serialization/PCHContainerOperations.h
+++ b/clang/include/clang/Serialization/PCHContainerOperations.h
@@ -22,8 +22,6 @@ class raw_pwrite_stream;
namespace clang {
class ASTConsumer;
-class CodeGenOptions;
-class DiagnosticsEngine;
class CompilerInstance;
struct PCHBuffer {
diff --git a/clang/include/clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h b/clang/include/clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h
index a6069d7dfdc0..bdfe3901c5b8 100644
--- a/clang/include/clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h
+++ b/clang/include/clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h
@@ -17,13 +17,9 @@
#include "clang/StaticAnalyzer/Core/BugReporter/CommonBugCategories.h"
namespace clang {
-
-class LangOptions;
-
namespace ento {
class CheckerManager;
-class CheckerRegistry;
#define GET_CHECKERS
#define CHECKER(FULLNAME, CLASS, HELPTEXT, DOC_URI, IS_HIDDEN) \
diff --git a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
index 3c93ebeccde8..9ec5bcc87554 100644
--- a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
+++ b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
@@ -48,7 +48,6 @@ namespace clang {
class AnalyzerOptions;
class ASTContext;
class Decl;
-class DiagnosticsEngine;
class LocationContext;
class SourceManager;
class Stmt;
@@ -61,7 +60,6 @@ class ExplodedGraph;
class ExplodedNode;
class ExprEngine;
class MemRegion;
-class SValBuilder;
//===----------------------------------------------------------------------===//
// Interface for individual bug reports.
diff --git a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h
index 49ab25eca2dd..558881176327 100644
--- a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h
+++ b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h
@@ -23,8 +23,6 @@ namespace clang {
namespace ento {
class BugReporter;
-class ExplodedNode;
-class ExprEngine;
class BugType {
private:
diff --git a/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h b/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h
index d2f71baa56a4..7e45d24e5695 100644
--- a/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h
+++ b/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h
@@ -28,7 +28,6 @@ namespace clang {
class AnalyzerOptions;
class CallExpr;
-class CXXNewExpr;
class Decl;
class LocationContext;
class Stmt;
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h b/clang/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h
index 71a590d9e9a2..2694aac478cd 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h
@@ -20,7 +20,6 @@
namespace clang {
-class AnalyzerOptions;
class MacroExpansionContext;
class Preprocessor;
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h
index bb598af68166..8a778389bcbe 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h
@@ -34,7 +34,6 @@
namespace clang {
class CXXBaseSpecifier;
-class DeclaratorDecl;
namespace ento {
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
index d135e70dd75d..bfaeb06951d7 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
@@ -76,7 +76,6 @@ enum CallEventKind {
};
class CallEvent;
-class CallDescription;
template<typename T = CallEvent>
class CallEventRef : public IntrusiveRefCntPtr<const T> {
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h
index a81d67ab3063..e89a993ca8d2 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h
@@ -24,7 +24,6 @@ namespace clang {
class Expr;
class VarDecl;
class QualType;
-class AttributedType;
class Preprocessor;
namespace ento {
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
index cef7dda172f3..feb4a72fe8d0 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
@@ -77,13 +77,9 @@ namespace ento {
class AnalysisManager;
class BasicValueFactory;
-class BlockCounter;
-class BranchNodeBuilder;
class CallEvent;
class CheckerManager;
class ConstraintManager;
-class CXXTempObjectRegion;
-class EndOfFunctionNodeBuilder;
class ExplodedNodeSet;
class ExplodedNode;
class IndirectGotoNodeBuilder;
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h
index 53b221cb53c9..eb2b0b343428 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h
@@ -28,7 +28,6 @@
#include "clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h"
namespace clang {
namespace ento {
-class AnalysisManager;
/// Returns if the given State indicates that is inside a completely unrolled
/// loop.
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
index 9a34639e2707..3204ac460ed0 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
@@ -47,8 +47,6 @@ typedef std::unique_ptr<StoreManager>(*StoreManagerCreator)(
// ProgramStateTrait - Traits used by the Generic Data Map of a ProgramState.
//===----------------------------------------------------------------------===//
-template <typename T> struct ProgramStatePartialTrait;
-
template <typename T> struct ProgramStateTrait {
typedef typename T::data_type data_type;
static inline void *MakeVoidPtr(data_type D) { return (void*) D; }
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h
index 6199c8d8d179..f4b229070d67 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h
@@ -35,7 +35,6 @@
namespace clang {
class CXXBaseSpecifier;
-class DeclaratorDecl;
class FunctionDecl;
class LabelDecl;
diff --git a/clang/include/clang/StaticAnalyzer/Frontend/AnalysisConsumer.h b/clang/include/clang/StaticAnalyzer/Frontend/AnalysisConsumer.h
index bcc29a60ad70..f3b1c1f20645 100644
--- a/clang/include/clang/StaticAnalyzer/Frontend/AnalysisConsumer.h
+++ b/clang/include/clang/StaticAnalyzer/Frontend/AnalysisConsumer.h
@@ -21,14 +21,10 @@
namespace clang {
-class Preprocessor;
-class DiagnosticsEngine;
-class CodeInjector;
class CompilerInstance;
namespace ento {
class PathDiagnosticConsumer;
-class CheckerManager;
class CheckerRegistry;
class AnalysisASTConsumer : public ASTConsumer {
diff --git a/clang/include/clang/StaticAnalyzer/Frontend/FrontendActions.h b/clang/include/clang/StaticAnalyzer/Frontend/FrontendActions.h
index 2b12330e4f2d..31b1c245200e 100644
--- a/clang/include/clang/StaticAnalyzer/Frontend/FrontendActions.h
+++ b/clang/include/clang/StaticAnalyzer/Frontend/FrontendActions.h
@@ -16,12 +16,9 @@
namespace clang {
class Stmt;
-class AnalyzerOptions;
namespace ento {
-class CheckerManager;
-
//===----------------------------------------------------------------------===//
// AST Consumer Actions
//===----------------------------------------------------------------------===//
diff --git a/clang/include/clang/Tooling/ASTDiff/ASTDiffInternal.h b/clang/include/clang/Tooling/ASTDiff/ASTDiffInternal.h
index 1e784ef43ac1..fb7bd4e8afa2 100644
--- a/clang/include/clang/Tooling/ASTDiff/ASTDiffInternal.h
+++ b/clang/include/clang/Tooling/ASTDiff/ASTDiffInternal.h
@@ -18,7 +18,6 @@ namespace diff {
using DynTypedNode = DynTypedNode;
class SyntaxTree;
-class SyntaxTreeImpl;
struct ComparisonOptions;
/// Within a tree, this identifies a node by its preorder offset.
diff --git a/clang/include/clang/Tooling/Refactoring/Rename/RenamingAction.h b/clang/include/clang/Tooling/Refactoring/Rename/RenamingAction.h
index 8e72076b7b5e..43a8d56e4e71 100644
--- a/clang/include/clang/Tooling/Refactoring/Rename/RenamingAction.h
+++ b/clang/include/clang/Tooling/Refactoring/Rename/RenamingAction.h
@@ -23,7 +23,6 @@
namespace clang {
class ASTConsumer;
-class CompilerInstance;
namespace tooling {
diff --git a/clang/include/clang/Tooling/Refactoring/Rename/USRFindingAction.h b/clang/include/clang/Tooling/Refactoring/Rename/USRFindingAction.h
index e43721bdccd1..e81b5c2345c9 100644
--- a/clang/include/clang/Tooling/Refactoring/Rename/USRFindingAction.h
+++ b/clang/include/clang/Tooling/Refactoring/Rename/USRFindingAction.h
@@ -23,7 +23,6 @@
namespace clang {
class ASTConsumer;
class ASTContext;
-class CompilerInstance;
class NamedDecl;
namespace tooling {
diff --git a/clang/include/clang/Tooling/Tooling.h b/clang/include/clang/Tooling/Tooling.h
index c9c6a2ffb7b3..b36f58ad3046 100644
--- a/clang/include/clang/Tooling/Tooling.h
+++ b/clang/include/clang/Tooling/Tooling.h
@@ -54,7 +54,6 @@ class CompilerInstance;
class CompilerInvocation;
class DiagnosticConsumer;
class DiagnosticsEngine;
-class SourceManager;
namespace driver {
diff --git a/clang/tools/libclang/CXType.h b/clang/tools/libclang/CXType.h
index 1d458086c09e..ffe70a9b1c3e 100644
--- a/clang/tools/libclang/CXType.h
+++ b/clang/tools/libclang/CXType.h
@@ -17,9 +17,6 @@
#include "clang/AST/Type.h"
namespace clang {
-
-class ASTUnit;
-
namespace cxtype {
CXType MakeCXType(QualType T, CXTranslationUnit TU);