diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-12-01 16:35:25 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-12-01 16:35:25 +0000 |
commit | 9852f58f50b4fc20914fbce5b4454135a42343f4 (patch) | |
tree | 138d7e4fde1e000469a213103b9e2f9cbcac15e1 | |
parent | 1bf43cae5d3175838242060cbbc08f6f4fce3536 (diff) | |
download | clang-9852f58f50b4fc20914fbce5b4454135a42343f4.tar.gz clang-9852f58f50b4fc20914fbce5b4454135a42343f4.tar.bz2 clang-9852f58f50b4fc20914fbce5b4454135a42343f4.tar.xz |
Don't include Type.h in DeclarationName.h.
Recursively prune some includes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169094 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/Decl.h | 23 | ||||
-rw-r--r-- | include/clang/AST/DeclBase.h | 37 | ||||
-rw-r--r-- | include/clang/AST/DeclarationName.h | 28 | ||||
-rw-r--r-- | include/clang/AST/Expr.h | 18 | ||||
-rw-r--r-- | include/clang/AST/ExternalASTSource.h | 2 | ||||
-rw-r--r-- | include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h | 1 | ||||
-rw-r--r-- | lib/ARCMigrate/TransRetainReleaseDealloc.cpp | 1 | ||||
-rw-r--r-- | lib/ARCMigrate/Transforms.cpp | 3 | ||||
-rw-r--r-- | lib/AST/DeclarationName.cpp | 15 | ||||
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 1 | ||||
-rw-r--r-- | lib/Rewrite/Frontend/RewriteModernObjC.cpp | 1 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp | 1 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp | 1 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Core/ExprEngineC.cpp | 1 |
14 files changed, 77 insertions, 56 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index d61e6dd7a4..a8ce7df5b2 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -16,33 +16,34 @@ #include "clang/AST/APValue.h" #include "clang/AST/DeclBase.h" -#include "clang/AST/Redeclarable.h" #include "clang/AST/DeclarationName.h" #include "clang/AST/ExternalASTSource.h" +#include "clang/AST/Redeclarable.h" +#include "clang/AST/Type.h" #include "clang/Basic/Linkage.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/Optional.h" #include "llvm/Support/Compiler.h" namespace clang { +struct ASTTemplateArgumentListInfo; class CXXTemporary; +class CompoundStmt; +class DependentFunctionTemplateSpecializationInfo; class Expr; class FunctionTemplateDecl; +class FunctionTemplateSpecializationInfo; +class LabelStmt; +class MemberSpecializationInfo; +class Module; +class NestedNameSpecifier; class Stmt; -class CompoundStmt; class StringLiteral; -class NestedNameSpecifier; -class TemplateParameterList; class TemplateArgumentList; -struct ASTTemplateArgumentListInfo; -class MemberSpecializationInfo; -class FunctionTemplateSpecializationInfo; -class DependentFunctionTemplateSpecializationInfo; +class TemplateParameterList; class TypeLoc; class UnresolvedSetImpl; -class LabelStmt; -class Module; - + /// \brief A container of type source information. /// /// A client can read the relevant info using TypeLoc wrappers, e.g: diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index 7865566bec..c5b1a09aeb 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -16,36 +16,37 @@ #include "clang/AST/AttrIterator.h" #include "clang/AST/DeclarationName.h" -#include "clang/AST/Type.h" #include "clang/Basic/Specifiers.h" #include "llvm/ADT/PointerUnion.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/PrettyStackTrace.h" namespace clang { -class DeclContext; -class TranslationUnitDecl; -class NamespaceDecl; -class UsingDirectiveDecl; -class NamedDecl; -class FunctionDecl; +class ASTMutationListener; +class BlockDecl; class CXXRecordDecl; +class CompoundStmt; +class DeclContext; +class DeclarationName; +class DependentDiagnostic; class EnumDecl; -class ObjCMethodDecl; -class ObjCContainerDecl; -class ObjCInterfaceDecl; +class FunctionDecl; +class LinkageSpecDecl; +class NamedDecl; +class NamespaceDecl; class ObjCCategoryDecl; -class ObjCProtocolDecl; -class ObjCImplementationDecl; class ObjCCategoryImplDecl; +class ObjCContainerDecl; class ObjCImplDecl; -class LinkageSpecDecl; -class BlockDecl; -class DeclarationName; -class CompoundStmt; +class ObjCImplementationDecl; +class ObjCInterfaceDecl; +class ObjCMethodDecl; +class ObjCProtocolDecl; +struct PrintingPolicy; +class Stmt; class StoredDeclsMap; -class DependentDiagnostic; -class ASTMutationListener; +class TranslationUnitDecl; +class UsingDirectiveDecl; } namespace llvm { diff --git a/include/clang/AST/DeclarationName.h b/include/clang/AST/DeclarationName.h index d991c73612..cf960bfd69 100644 --- a/include/clang/AST/DeclarationName.h +++ b/include/clang/AST/DeclarationName.h @@ -14,8 +14,6 @@ #define LLVM_CLANG_AST_DECLARATIONNAME_H #include "clang/Basic/IdentifierTable.h" -#include "clang/AST/Type.h" -#include "clang/AST/CanonicalType.h" #include "clang/Basic/PartialDiagnostic.h" #include "llvm/Support/Compiler.h" @@ -24,14 +22,20 @@ namespace llvm { } namespace clang { - class CXXSpecialName; - class CXXOperatorIdName; + class ASTContext; class CXXLiteralOperatorIdName; + class CXXOperatorIdName; + class CXXSpecialName; class DeclarationNameExtra; class IdentifierInfo; class MultiKeywordSelector; - class UsingDirectiveDecl; + class QualType; + class Type; class TypeSourceInfo; + class UsingDirectiveDecl; + + template <typename> class CanQual; + typedef CanQual<Type> CanQualType; /// DeclarationName - The name of a declaration. In the common case, /// this just stores an IdentifierInfo pointer to a normal @@ -349,23 +353,15 @@ public: /// getCXXConstructorName - Returns the name of a C++ constructor /// for the given Type. - DeclarationName getCXXConstructorName(CanQualType Ty) { - return getCXXSpecialName(DeclarationName::CXXConstructorName, - Ty.getUnqualifiedType()); - } + DeclarationName getCXXConstructorName(CanQualType Ty); /// getCXXDestructorName - Returns the name of a C++ destructor /// for the given Type. - DeclarationName getCXXDestructorName(CanQualType Ty) { - return getCXXSpecialName(DeclarationName::CXXDestructorName, - Ty.getUnqualifiedType()); - } + DeclarationName getCXXDestructorName(CanQualType Ty); /// getCXXConversionFunctionName - Returns the name of a C++ /// conversion function for the given Type. - DeclarationName getCXXConversionFunctionName(CanQualType Ty) { - return getCXXSpecialName(DeclarationName::CXXConversionFunctionName, Ty); - } + DeclarationName getCXXConversionFunctionName(CanQualType Ty); /// getCXXSpecialName - Returns a declaration name for special kind /// of C++ name, e.g., for a constructor, destructor, or conversion diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index ac35bf8bd6..429a6e57d6 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -22,7 +22,6 @@ #include "clang/AST/OperationKinds.h" #include "clang/AST/ASTVector.h" #include "clang/AST/TemplateBase.h" -#include "clang/Basic/TargetInfo.h" #include "clang/Basic/TypeTraits.h" #include "llvm/ADT/APSInt.h" #include "llvm/ADT/APFloat.h" @@ -32,21 +31,22 @@ #include <cctype> namespace clang { - class ASTContext; class APValue; - class CastExpr; - class Decl; - class IdentifierInfo; - class ParmVarDecl; - class NamedDecl; - class ValueDecl; + class ASTContext; class BlockDecl; class CXXBaseSpecifier; + class CXXMemberCallExpr; class CXXOperatorCallExpr; + class CastExpr; + class Decl; + class IdentifierInfo; class MaterializeTemporaryExpr; - class CXXMemberCallExpr; + class NamedDecl; class ObjCPropertyRefExpr; class OpaqueValueExpr; + class ParmVarDecl; + class TargetInfo; + class ValueDecl; /// \brief A simple array of base specifiers. typedef SmallVector<CXXBaseSpecifier*, 4> CXXCastPath; diff --git a/include/clang/AST/ExternalASTSource.h b/include/clang/AST/ExternalASTSource.h index db2bddb4bf..826e95b109 100644 --- a/include/clang/AST/ExternalASTSource.h +++ b/include/clang/AST/ExternalASTSource.h @@ -24,7 +24,9 @@ class ASTConsumer; class CXXBaseSpecifier; class DeclarationName; class ExternalSemaSource; // layering violation required for downcasting +class FieldDecl; class NamedDecl; +class RecordDecl; class Selector; class Stmt; class TagDecl; diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h b/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h index 17c6b8337b..329dbf988d 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h @@ -17,7 +17,6 @@ #include "clang/AST/ASTContext.h" #include "clang/AST/Expr.h" -#include "clang/AST/ExprCXX.h" #include "clang/AST/ExprObjC.h" #include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h" #include "clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h" diff --git a/lib/ARCMigrate/TransRetainReleaseDealloc.cpp b/lib/ARCMigrate/TransRetainReleaseDealloc.cpp index dec4903b2d..aa7e25b39a 100644 --- a/lib/ARCMigrate/TransRetainReleaseDealloc.cpp +++ b/lib/ARCMigrate/TransRetainReleaseDealloc.cpp @@ -24,6 +24,7 @@ #include "clang/Basic/SourceManager.h" #include "clang/Lex/Lexer.h" #include "clang/Sema/SemaDiagnostic.h" +#include "llvm/ADT/StringSwitch.h" using namespace clang; using namespace arcmt; diff --git a/lib/ARCMigrate/Transforms.cpp b/lib/ARCMigrate/Transforms.cpp index 21f137e410..7383e8df6f 100644 --- a/lib/ARCMigrate/Transforms.cpp +++ b/lib/ARCMigrate/Transforms.cpp @@ -14,11 +14,12 @@ #include "clang/AST/RecursiveASTVisitor.h" #include "clang/AST/StmtVisitor.h" #include "clang/Basic/SourceManager.h" +#include "clang/Basic/TargetInfo.h" #include "clang/Lex/Lexer.h" #include "clang/Sema/Sema.h" #include "clang/Sema/SemaDiagnostic.h" -#include "llvm/ADT/StringSwitch.h" #include "llvm/ADT/DenseSet.h" +#include "llvm/ADT/StringSwitch.h" #include <map> using namespace clang; diff --git a/lib/AST/DeclarationName.cpp b/lib/AST/DeclarationName.cpp index 28188d91c1..e4a41b6ffb 100644 --- a/lib/AST/DeclarationName.cpp +++ b/lib/AST/DeclarationName.cpp @@ -364,6 +364,21 @@ DeclarationNameTable::~DeclarationNameTable() { delete LiteralNames; } +DeclarationName DeclarationNameTable::getCXXConstructorName(CanQualType Ty) { + return getCXXSpecialName(DeclarationName::CXXConstructorName, + Ty.getUnqualifiedType()); +} + +DeclarationName DeclarationNameTable::getCXXDestructorName(CanQualType Ty) { + return getCXXSpecialName(DeclarationName::CXXDestructorName, + Ty.getUnqualifiedType()); +} + +DeclarationName +DeclarationNameTable::getCXXConversionFunctionName(CanQualType Ty) { + return getCXXSpecialName(DeclarationName::CXXConversionFunctionName, Ty); +} + DeclarationName DeclarationNameTable::getCXXSpecialName(DeclarationName::NameKind Kind, CanQualType Ty) { diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 23d1f40e9e..9a8f8005cf 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -13,6 +13,7 @@ #include "clang/Parse/Parser.h" #include "clang/Parse/ParseDiagnostic.h" +#include "clang/Basic/AddressSpaces.h" #include "clang/Basic/OpenCL.h" #include "clang/Sema/Lookup.h" #include "clang/Sema/Scope.h" diff --git a/lib/Rewrite/Frontend/RewriteModernObjC.cpp b/lib/Rewrite/Frontend/RewriteModernObjC.cpp index 01811f642a..c16f15a134 100644 --- a/lib/Rewrite/Frontend/RewriteModernObjC.cpp +++ b/lib/Rewrite/Frontend/RewriteModernObjC.cpp @@ -20,6 +20,7 @@ #include "clang/Basic/Diagnostic.h" #include "clang/Basic/IdentifierTable.h" #include "clang/Basic/SourceManager.h" +#include "clang/Basic/TargetInfo.h" #include "clang/Lex/Lexer.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/OwningPtr.h" diff --git a/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp b/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp index e7e316281f..4cb59539ec 100644 --- a/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp @@ -11,6 +11,7 @@ #include "clang/StaticAnalyzer/Core/Checker.h" #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h" +#include "llvm/ADT/StringSwitch.h" using namespace clang; using namespace ento; diff --git a/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp b/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp index 0c2f266837..f353c9a382 100644 --- a/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp @@ -18,6 +18,7 @@ #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h" #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h" #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h" +#include "clang/AST/ExprCXX.h" #include "clang/Basic/SourceManager.h" #include "llvm/ADT/SmallString.h" using namespace clang; diff --git a/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/lib/StaticAnalyzer/Core/ExprEngineC.cpp index d5a5762e98..3444557553 100644 --- a/lib/StaticAnalyzer/Core/ExprEngineC.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngineC.cpp @@ -11,6 +11,7 @@ // //===----------------------------------------------------------------------===// +#include "clang/AST/ExprCXX.h" #include "clang/StaticAnalyzer/Core/CheckerManager.h" #include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h" |