[PATCH] D159320: [NFC] Cleanup some #includes in header files
This revision was automatically updated to reflect the committed changes. Closed by commit rG671365225ccc: [NFC] Cleanup some #includes in header files (authored by void). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159320/new/ https://reviews.llvm.org/D159320 Files: clang/include/clang/AST/ASTConcept.h clang/include/clang/AST/ASTContext.h clang/lib/AST/ASTConcept.cpp clang/lib/AST/DeclTemplate.cpp Index: clang/lib/AST/DeclTemplate.cpp === --- clang/lib/AST/DeclTemplate.cpp +++ clang/lib/AST/DeclTemplate.cpp @@ -1552,20 +1552,6 @@ createBuiltinTemplateParameterList(C, DC, BTK)), BTK(BTK) {} -void ConceptReference::print(llvm::raw_ostream , - const PrintingPolicy ) const { - if (NestedNameSpec) -NestedNameSpec.getNestedNameSpecifier()->print(OS, Policy); - ConceptName.printName(OS, Policy); - if (hasExplicitTemplateArgs()) { -OS << "<"; -// FIXME: Find corresponding parameter for argument -for (auto : ArgsAsWritten->arguments()) - ArgLoc.getArgument().print(Policy, OS, /*IncludeType*/ false); -OS << ">"; - } -} - TemplateParamObjectDecl *TemplateParamObjectDecl::Create(const ASTContext , QualType T, const APValue ) { Index: clang/lib/AST/ASTConcept.cpp === --- clang/lib/AST/ASTConcept.cpp +++ clang/lib/AST/ASTConcept.cpp @@ -13,10 +13,9 @@ #include "clang/AST/ASTConcept.h" #include "clang/AST/ASTContext.h" -#include "clang/AST/Decl.h" -#include "clang/AST/TemplateBase.h" +#include "clang/AST/PrettyPrinter.h" #include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/FoldingSet.h" + using namespace clang; namespace { @@ -89,3 +88,27 @@ for (auto : TemplateArgs) Arg.Profile(ID, C); } + +ConceptReference * +ConceptReference::Create(const ASTContext , NestedNameSpecifierLoc NNS, + SourceLocation TemplateKWLoc, + DeclarationNameInfo ConceptNameInfo, + NamedDecl *FoundDecl, ConceptDecl *NamedConcept, + const ASTTemplateArgumentListInfo *ArgsAsWritten) { + return new (C) ConceptReference(NNS, TemplateKWLoc, ConceptNameInfo, + FoundDecl, NamedConcept, ArgsAsWritten); +} + +void ConceptReference::print(llvm::raw_ostream , + const PrintingPolicy ) const { + if (NestedNameSpec) +NestedNameSpec.getNestedNameSpecifier()->print(OS, Policy); + ConceptName.printName(OS, Policy); + if (hasExplicitTemplateArgs()) { +OS << "<"; +// FIXME: Find corresponding parameter for argument +for (auto : ArgsAsWritten->arguments()) + ArgLoc.getArgument().print(Policy, OS, /*IncludeType*/ false); +OS << ">"; + } +} Index: clang/include/clang/AST/ASTContext.h === --- clang/include/clang/AST/ASTContext.h +++ clang/include/clang/AST/ASTContext.h @@ -21,7 +21,6 @@ #include "clang/AST/Decl.h" #include "clang/AST/DeclarationName.h" #include "clang/AST/ExternalASTSource.h" -#include "clang/AST/NestedNameSpecifier.h" #include "clang/AST/PrettyPrinter.h" #include "clang/AST/RawCommentList.h" #include "clang/AST/TemplateName.h" @@ -81,6 +80,7 @@ class MemberSpecializationInfo; class Module; struct MSGuidDeclParts; +class NestedNameSpecifier; class ObjCCategoryDecl; class ObjCCategoryImplDecl; class ObjCContainerDecl; Index: clang/include/clang/AST/ASTConcept.h === --- clang/include/clang/AST/ASTConcept.h +++ clang/include/clang/AST/ASTConcept.h @@ -14,16 +14,21 @@ #ifndef LLVM_CLANG_AST_ASTCONCEPT_H #define LLVM_CLANG_AST_ASTCONCEPT_H -#include "clang/AST/Decl.h" -#include "clang/AST/Expr.h" -#include "clang/AST/PrettyPrinter.h" +#include "clang/AST/DeclarationName.h" +#include "clang/AST/NestedNameSpecifier.h" +#include "clang/AST/TemplateBase.h" #include "clang/Basic/SourceLocation.h" +#include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/PointerUnion.h" #include "llvm/ADT/SmallVector.h" #include namespace clang { + class ConceptDecl; +class Expr; +class NamedDecl; +struct PrintingPolicy; /// The result of a constraint satisfaction check, containing the necessary /// information to diagnose an unsatisfied constraint. @@ -157,10 +162,7 @@ Create(const ASTContext , NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, - const ASTTemplateArgumentListInfo *ArgsAsWritten) { -return new (C) ConceptReference(NNS, TemplateKWLoc, ConceptNameInfo, -FoundDecl,
[PATCH] D159320: [NFC] Cleanup some #includes in header files
void created this revision. void added reviewers: nickdesaulniers, erichkeane. Herald added a subscriber: ChuanqiXu. Herald added a project: All. void requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Limit the #includes to the least necessary to still compile. Move the "new" function into the .cpp file to remove the need to #include ASTContext.h into ASTConcept.h. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D159320 Files: clang/include/clang/AST/ASTConcept.h clang/include/clang/AST/ASTContext.h clang/lib/AST/ASTConcept.cpp clang/lib/AST/DeclTemplate.cpp Index: clang/lib/AST/DeclTemplate.cpp === --- clang/lib/AST/DeclTemplate.cpp +++ clang/lib/AST/DeclTemplate.cpp @@ -1552,20 +1552,6 @@ createBuiltinTemplateParameterList(C, DC, BTK)), BTK(BTK) {} -void ConceptReference::print(llvm::raw_ostream , - const PrintingPolicy ) const { - if (NestedNameSpec) -NestedNameSpec.getNestedNameSpecifier()->print(OS, Policy); - ConceptName.printName(OS, Policy); - if (hasExplicitTemplateArgs()) { -OS << "<"; -// FIXME: Find corresponding parameter for argument -for (auto : ArgsAsWritten->arguments()) - ArgLoc.getArgument().print(Policy, OS, /*IncludeType*/ false); -OS << ">"; - } -} - TemplateParamObjectDecl *TemplateParamObjectDecl::Create(const ASTContext , QualType T, const APValue ) { Index: clang/lib/AST/ASTConcept.cpp === --- clang/lib/AST/ASTConcept.cpp +++ clang/lib/AST/ASTConcept.cpp @@ -13,10 +13,9 @@ #include "clang/AST/ASTConcept.h" #include "clang/AST/ASTContext.h" -#include "clang/AST/Decl.h" -#include "clang/AST/TemplateBase.h" +#include "clang/AST/PrettyPrinter.h" #include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/FoldingSet.h" + using namespace clang; namespace { @@ -89,3 +88,27 @@ for (auto : TemplateArgs) Arg.Profile(ID, C); } + +ConceptReference * +ConceptReference::Create(const ASTContext , NestedNameSpecifierLoc NNS, + SourceLocation TemplateKWLoc, + DeclarationNameInfo ConceptNameInfo, + NamedDecl *FoundDecl, ConceptDecl *NamedConcept, + const ASTTemplateArgumentListInfo *ArgsAsWritten) { + return new (C) ConceptReference(NNS, TemplateKWLoc, ConceptNameInfo, + FoundDecl, NamedConcept, ArgsAsWritten); +} + +void ConceptReference::print(llvm::raw_ostream , + const PrintingPolicy ) const { + if (NestedNameSpec) +NestedNameSpec.getNestedNameSpecifier()->print(OS, Policy); + ConceptName.printName(OS, Policy); + if (hasExplicitTemplateArgs()) { +OS << "<"; +// FIXME: Find corresponding parameter for argument +for (auto : ArgsAsWritten->arguments()) + ArgLoc.getArgument().print(Policy, OS, /*IncludeType*/ false); +OS << ">"; + } +} Index: clang/include/clang/AST/ASTContext.h === --- clang/include/clang/AST/ASTContext.h +++ clang/include/clang/AST/ASTContext.h @@ -21,7 +21,6 @@ #include "clang/AST/Decl.h" #include "clang/AST/DeclarationName.h" #include "clang/AST/ExternalASTSource.h" -#include "clang/AST/NestedNameSpecifier.h" #include "clang/AST/PrettyPrinter.h" #include "clang/AST/RawCommentList.h" #include "clang/AST/TemplateName.h" @@ -81,6 +80,7 @@ class MemberSpecializationInfo; class Module; struct MSGuidDeclParts; +class NestedNameSpecifier; class ObjCCategoryDecl; class ObjCCategoryImplDecl; class ObjCContainerDecl; Index: clang/include/clang/AST/ASTConcept.h === --- clang/include/clang/AST/ASTConcept.h +++ clang/include/clang/AST/ASTConcept.h @@ -14,16 +14,21 @@ #ifndef LLVM_CLANG_AST_ASTCONCEPT_H #define LLVM_CLANG_AST_ASTCONCEPT_H -#include "clang/AST/Decl.h" -#include "clang/AST/Expr.h" -#include "clang/AST/PrettyPrinter.h" +#include "clang/AST/DeclarationName.h" +#include "clang/AST/NestedNameSpecifier.h" +#include "clang/AST/TemplateBase.h" #include "clang/Basic/SourceLocation.h" +#include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/PointerUnion.h" #include "llvm/ADT/SmallVector.h" #include namespace clang { + class ConceptDecl; +class Expr; +class NamedDecl; +struct PrintingPolicy; /// The result of a constraint satisfaction check, containing the necessary /// information to diagnose an unsatisfied constraint. @@ -157,10 +162,7 @@ Create(const ASTContext , NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, -