From d1b127b5b747a1c10409825c400da9bbfac70f2d Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 8 Jan 2022 11:56:40 -0800 Subject: [PATCH] [clang] Remove unused forward declarations (NFC) --- clang/lib/AST/CXXABI.h | 1 - clang/lib/AST/Interp/ByteCodeExprGen.h | 2 -- clang/lib/AST/Interp/ByteCodeStmtGen.h | 4 ---- clang/lib/AST/Interp/Context.h | 1 - clang/lib/AST/Interp/InterpBlock.h | 2 -- clang/lib/AST/Interp/Pointer.h | 3 --- clang/lib/AST/Interp/Program.h | 3 --- clang/lib/CodeGen/CGBlocks.h | 7 ------- clang/lib/CodeGen/CGCXXABI.h | 1 - clang/lib/CodeGen/CGCall.h | 4 ---- clang/lib/CodeGen/CGCleanup.h | 1 - clang/lib/CodeGen/CGDebugInfo.h | 1 - clang/lib/CodeGen/CGOpenMPRuntime.h | 2 -- clang/lib/CodeGen/CodeGenFunction.h | 6 ------ clang/lib/CodeGen/CodeGenModule.h | 10 ---------- clang/lib/CodeGen/CodeGenTBAA.h | 1 - clang/lib/CodeGen/CodeGenTypes.h | 5 ----- clang/lib/CodeGen/MacroPPCallbacks.h | 1 - clang/lib/CodeGen/TargetInfo.h | 1 - clang/lib/Format/TokenAnnotator.h | 2 -- clang/lib/Interpreter/IncrementalParser.h | 3 --- clang/lib/Serialization/ASTReaderInternals.h | 1 - clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.h | 4 ---- .../StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.h | 1 - clang/lib/StaticAnalyzer/Frontend/ModelInjector.h | 3 --- 25 files changed, 70 deletions(-) diff --git a/clang/lib/AST/CXXABI.h b/clang/lib/AST/CXXABI.h index ca9424bcb7a4..9258a53fefeb 100644 --- a/clang/lib/AST/CXXABI.h +++ b/clang/lib/AST/CXXABI.h @@ -21,7 +21,6 @@ namespace clang { class ASTContext; class CXXConstructorDecl; class DeclaratorDecl; -class Expr; class MangleContext; class MangleNumberingContext; class MemberPointerType; diff --git a/clang/lib/AST/Interp/ByteCodeExprGen.h b/clang/lib/AST/Interp/ByteCodeExprGen.h index 716f28551e58..124a6ff03f18 100644 --- a/clang/lib/AST/Interp/ByteCodeExprGen.h +++ b/clang/lib/AST/Interp/ByteCodeExprGen.h @@ -28,8 +28,6 @@ namespace clang { class QualType; namespace interp { -class Function; -class State; template class LocalScope; template class RecordScope; diff --git a/clang/lib/AST/Interp/ByteCodeStmtGen.h b/clang/lib/AST/Interp/ByteCodeStmtGen.h index d9c0b64ed4b8..3bc665b84b4d 100644 --- a/clang/lib/AST/Interp/ByteCodeStmtGen.h +++ b/clang/lib/AST/Interp/ByteCodeStmtGen.h @@ -25,11 +25,7 @@ #include "llvm/ADT/Optional.h" namespace clang { -class QualType; - namespace interp { -class Function; -class State; template class LoopScope; template class SwitchScope; diff --git a/clang/lib/AST/Interp/Context.h b/clang/lib/AST/Interp/Context.h index 4f25ff977b81..0627d9fb14f5 100644 --- a/clang/lib/AST/Interp/Context.h +++ b/clang/lib/AST/Interp/Context.h @@ -23,7 +23,6 @@ namespace clang { class ASTContext; class LangOptions; -class Stmt; class FunctionDecl; class VarDecl; diff --git a/clang/lib/AST/Interp/InterpBlock.h b/clang/lib/AST/Interp/InterpBlock.h index 0ccdef221c83..2d5386e60b8c 100644 --- a/clang/lib/AST/Interp/InterpBlock.h +++ b/clang/lib/AST/Interp/InterpBlock.h @@ -25,10 +25,8 @@ namespace clang { namespace interp { class Block; class DeadBlock; -class Context; class InterpState; class Pointer; -class Function; enum PrimType : unsigned; /// A memory block, either on the stack or in the heap. diff --git a/clang/lib/AST/Interp/Pointer.h b/clang/lib/AST/Interp/Pointer.h index f2f6e0e76018..587531aec82a 100644 --- a/clang/lib/AST/Interp/Pointer.h +++ b/clang/lib/AST/Interp/Pointer.h @@ -26,10 +26,7 @@ namespace clang { namespace interp { class Block; class DeadBlock; -class Context; -class InterpState; class Pointer; -class Function; enum PrimType : unsigned; /// A pointer to a memory block, live or dead. diff --git a/clang/lib/AST/Interp/Program.h b/clang/lib/AST/Interp/Program.h index c81ec777a5fe..ca985af8ad30 100644 --- a/clang/lib/AST/Interp/Program.h +++ b/clang/lib/AST/Interp/Program.h @@ -29,15 +29,12 @@ namespace clang { class RecordDecl; class Expr; class FunctionDecl; -class Stmt; class StringLiteral; class VarDecl; namespace interp { class Context; -class State; class Record; -class Scope; /// The program contains and links the bytecode for all functions. class Program { diff --git a/clang/lib/CodeGen/CGBlocks.h b/clang/lib/CodeGen/CGBlocks.h index 698ecd3d926a..552d720b0a1d 100644 --- a/clang/lib/CodeGen/CGBlocks.h +++ b/clang/lib/CodeGen/CGBlocks.h @@ -26,14 +26,7 @@ #include "clang/Basic/TargetInfo.h" namespace llvm { -class Constant; -class Function; -class GlobalValue; -class DataLayout; -class FunctionType; -class PointerType; class Value; -class LLVMContext; } namespace clang { diff --git a/clang/lib/CodeGen/CGCXXABI.h b/clang/lib/CodeGen/CGCXXABI.h index ea839db7528e..e94e19bab0ad 100644 --- a/clang/lib/CodeGen/CGCXXABI.h +++ b/clang/lib/CodeGen/CGCXXABI.h @@ -31,7 +31,6 @@ class CXXConstructorDecl; class CXXDestructorDecl; class CXXMethodDecl; class CXXRecordDecl; -class FieldDecl; class MangleContext; namespace CodeGen { diff --git a/clang/lib/CodeGen/CGCall.h b/clang/lib/CodeGen/CGCall.h index 8d63739fbbad..d2bb104a3f9d 100644 --- a/clang/lib/CodeGen/CGCall.h +++ b/clang/lib/CodeGen/CGCall.h @@ -26,17 +26,13 @@ #include "ABIInfo.h" namespace llvm { -class AttributeList; -class Function; class Type; class Value; } // namespace llvm namespace clang { -class ASTContext; class Decl; class FunctionDecl; -class ObjCMethodDecl; class VarDecl; namespace CodeGen { diff --git a/clang/lib/CodeGen/CGCleanup.h b/clang/lib/CodeGen/CGCleanup.h index 76f3a48f32f3..079a3e25d6dc 100644 --- a/clang/lib/CodeGen/CGCleanup.h +++ b/clang/lib/CodeGen/CGCleanup.h @@ -23,7 +23,6 @@ namespace llvm { class BasicBlock; class Value; class ConstantInt; -class AllocaInst; } namespace clang { diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h index d782bd97f590..a76426e585c8 100644 --- a/clang/lib/CodeGen/CGDebugInfo.h +++ b/clang/lib/CodeGen/CGDebugInfo.h @@ -40,7 +40,6 @@ class ClassTemplateSpecializationDecl; class GlobalDecl; class ModuleMap; class ObjCInterfaceDecl; -class ObjCIvarDecl; class UsingDecl; class VarDecl; enum class DynamicInitKind : unsigned; diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.h b/clang/lib/CodeGen/CGOpenMPRuntime.h index b83ec78696d1..19754b0cfacc 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.h +++ b/clang/lib/CodeGen/CGOpenMPRuntime.h @@ -35,7 +35,6 @@ class ArrayType; class Constant; class FunctionType; class GlobalVariable; -class StructType; class Type; class Value; class OpenMPIRBuilder; @@ -48,7 +47,6 @@ class OMPExecutableDirective; class OMPLoopDirective; class VarDecl; class OMPDeclareReductionDecl; -class IdentifierInfo; namespace CodeGen { class Address; diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index b7011a08299a..6db888dcec08 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -46,7 +46,6 @@ namespace llvm { class BasicBlock; class LLVMContext; class MDNode; -class Module; class SwitchInst; class Twine; class Value; @@ -55,13 +54,11 @@ class CanonicalLoopInfo; namespace clang { class ASTContext; -class BlockDecl; class CXXDestructorDecl; class CXXForRangeStmt; class CXXTryStmt; class Decl; class LabelDecl; -class EnumConstantDecl; class FunctionDecl; class FunctionProtoType; class LabelStmt; @@ -80,7 +77,6 @@ class ObjCAtSynchronizedStmt; class ObjCAutoreleasePoolStmt; class OMPUseDevicePtrClause; class OMPUseDeviceAddrClause; -class ReturnsNonNullAttr; class SVETypeFlags; class OMPExecutableDirective; @@ -92,12 +88,10 @@ namespace CodeGen { class CodeGenTypes; class CGCallee; class CGFunctionInfo; -class CGRecordLayout; class CGBlockInfo; class CGCXXABI; class BlockByrefHelpers; class BlockByrefInfo; -class BlockFlags; class BlockFieldFlags; class RegionCodeGenTy; class TargetCodeGenInfo; diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 7cb6935afb20..f18de6e4b861 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -46,7 +46,6 @@ class GlobalValue; class DataLayout; class FunctionType; class LLVMContext; -class OpenMPIRBuilder; class IndexedInstrProfReader; } @@ -55,17 +54,13 @@ class ASTContext; class AtomicType; class FunctionDecl; class IdentifierInfo; -class ObjCMethodDecl; class ObjCImplementationDecl; -class ObjCCategoryImplDecl; -class ObjCProtocolDecl; class ObjCEncodeExpr; class BlockExpr; class CharUnits; class Decl; class Expr; class Stmt; -class InitListExpr; class StringLiteral; class NamedDecl; class ValueDecl; @@ -78,13 +73,10 @@ class AnnotateAttr; class CXXDestructorDecl; class Module; class CoverageSourceInfo; -class TargetAttr; class InitSegAttr; -struct ParsedTargetAttr; namespace CodeGen { -class CallArgList; class CodeGenFunction; class CodeGenTBAA; class CGCXXABI; @@ -93,8 +85,6 @@ class CGObjCRuntime; class CGOpenCLRuntime; class CGOpenMPRuntime; class CGCUDARuntime; -class BlockFieldFlags; -class FunctionArgList; class CoverageMappingModuleGen; class TargetCodeGenInfo; diff --git a/clang/lib/CodeGen/CodeGenTBAA.h b/clang/lib/CodeGen/CodeGenTBAA.h index e8e006f41616..a65963596fe9 100644 --- a/clang/lib/CodeGen/CodeGenTBAA.h +++ b/clang/lib/CodeGen/CodeGenTBAA.h @@ -29,7 +29,6 @@ namespace clang { class Type; namespace CodeGen { -class CGRecordLayout; // TBAAAccessKind - A kind of TBAA memory access descriptor. enum class TBAAAccessKind : unsigned { diff --git a/clang/lib/CodeGen/CodeGenTypes.h b/clang/lib/CodeGen/CodeGenTypes.h index f8f7542e4c83..28b831222943 100644 --- a/clang/lib/CodeGen/CodeGenTypes.h +++ b/clang/lib/CodeGen/CodeGenTypes.h @@ -31,14 +31,9 @@ namespace clang { class ASTContext; template class CanQual; class CXXConstructorDecl; -class CXXDestructorDecl; class CXXMethodDecl; class CodeGenOptions; -class FieldDecl; class FunctionProtoType; -class ObjCInterfaceDecl; -class ObjCIvarDecl; -class PointerType; class QualType; class RecordDecl; class TagDecl; diff --git a/clang/lib/CodeGen/MacroPPCallbacks.h b/clang/lib/CodeGen/MacroPPCallbacks.h index 32906a000269..d249b5b0eb88 100644 --- a/clang/lib/CodeGen/MacroPPCallbacks.h +++ b/clang/lib/CodeGen/MacroPPCallbacks.h @@ -17,7 +17,6 @@ namespace llvm { class DIMacroFile; -class DIMacroNode; } namespace clang { class Preprocessor; diff --git a/clang/lib/CodeGen/TargetInfo.h b/clang/lib/CodeGen/TargetInfo.h index aa8bbb60a75f..dfdb2f5f55bb 100644 --- a/clang/lib/CodeGen/TargetInfo.h +++ b/clang/lib/CodeGen/TargetInfo.h @@ -38,7 +38,6 @@ class ABIInfo; class CallArgList; class CodeGenFunction; class CGBlockInfo; -class CGFunctionInfo; /// TargetCodeGenInfo - This class organizes various target-specific /// codegeneration issues, like target-specific attributes, builtins and so diff --git a/clang/lib/Format/TokenAnnotator.h b/clang/lib/Format/TokenAnnotator.h index 384a671c981f..ecd9dbb0f864 100644 --- a/clang/lib/Format/TokenAnnotator.h +++ b/clang/lib/Format/TokenAnnotator.h @@ -19,8 +19,6 @@ #include "clang/Format/Format.h" namespace clang { -class SourceManager; - namespace format { enum LineType { diff --git a/clang/lib/Interpreter/IncrementalParser.h b/clang/lib/Interpreter/IncrementalParser.h index e5ce798025d9..d1f454f21239 100644 --- a/clang/lib/Interpreter/IncrementalParser.h +++ b/clang/lib/Interpreter/IncrementalParser.h @@ -30,9 +30,6 @@ class LLVMContext; namespace clang { class ASTConsumer; class CompilerInstance; -class CodeGenerator; -class DeclGroupRef; -class FrontendAction; class IncrementalAction; class Parser; diff --git a/clang/lib/Serialization/ASTReaderInternals.h b/clang/lib/Serialization/ASTReaderInternals.h index 265a77fdb215..4a4cfcce156d 100644 --- a/clang/lib/Serialization/ASTReaderInternals.h +++ b/clang/lib/Serialization/ASTReaderInternals.h @@ -30,7 +30,6 @@ class ASTReader; class FileEntry; struct HeaderFileInfo; class HeaderSearch; -class IdentifierTable; class ObjCMethodDecl; namespace serialization { diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.h b/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.h index ec6a7144fa45..e35ea4ef05dd 100644 --- a/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.h +++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.h @@ -17,10 +17,6 @@ #include namespace clang { -class CXXRecordDecl; -class CXXBaseSpecifier; -class FunctionDecl; -class CXXMethodDecl; class Expr; /// This function de-facto defines a set of transformations that we consider diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.h b/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.h index 730a59977175..753adea0d14d 100644 --- a/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.h +++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.h @@ -15,7 +15,6 @@ namespace clang { class CXXBaseSpecifier; class CXXMethodDecl; class CXXRecordDecl; -class Expr; class FunctionDecl; class Type; diff --git a/clang/lib/StaticAnalyzer/Frontend/ModelInjector.h b/clang/lib/StaticAnalyzer/Frontend/ModelInjector.h index d2016c3b112c..4db26028362f 100644 --- a/clang/lib/StaticAnalyzer/Frontend/ModelInjector.h +++ b/clang/lib/StaticAnalyzer/Frontend/ModelInjector.h @@ -29,10 +29,7 @@ namespace clang { class CompilerInstance; -class ASTUnit; -class ASTReader; class NamedDecl; -class Module; namespace ento { class ModelInjector : public CodeInjector {