From: Daniel Dunbar Date: Mon, 11 Aug 2008 03:45:03 +0000 (+0000) Subject: More #include cleaning X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e4858a65a93fb36c099d8dd2ea0a98e33e77687e;p=clang More #include cleaning - Drop Diagnostic.h from DeclSpec.h, move utility Diag methods into implementation .cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54626 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Parse/DeclSpec.h b/include/clang/Parse/DeclSpec.h index df5109d196..4f53de9462 100644 --- a/include/clang/Parse/DeclSpec.h +++ b/include/clang/Parse/DeclSpec.h @@ -14,13 +14,13 @@ #ifndef LLVM_CLANG_PARSE_SEMADECLSPEC_H #define LLVM_CLANG_PARSE_SEMADECLSPEC_H -#include "clang/Basic/Diagnostic.h" #include "clang/Parse/Action.h" #include "clang/Parse/AttributeList.h" #include "llvm/ADT/SmallVector.h" namespace clang { struct LangOptions; + class Diagnostic; class IdentifierInfo; /// DeclSpec - This class captures information about "declaration specifiers", @@ -303,14 +303,10 @@ public: private: void Diag(Diagnostic &D, SourceLocation Loc, SourceManager& SrcMgr, - unsigned DiagID) { - D.Report(FullSourceLoc(Loc,SrcMgr), DiagID); - } + unsigned DiagID); void Diag(Diagnostic &D, SourceLocation Loc, SourceManager& SrcMgr, - unsigned DiagID, const std::string &info) { - D.Report(FullSourceLoc(Loc,SrcMgr), DiagID, &info, 1); - } + unsigned DiagID, const std::string &info); }; /// ObjCDeclSpec - This class captures information about diff --git a/lib/Parse/DeclSpec.cpp b/lib/Parse/DeclSpec.cpp index d97dcfac80..5c26ec6857 100644 --- a/lib/Parse/DeclSpec.cpp +++ b/lib/Parse/DeclSpec.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "clang/Parse/DeclSpec.h" +#include "clang/Basic/Diagnostic.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/SourceLocation.h" using namespace clang; @@ -288,3 +289,13 @@ void DeclSpec::Finish(Diagnostic &D, SourceManager& SrcMgr, // 'data definition has no type or storage class'? } + +void DeclSpec::Diag(Diagnostic &D, SourceLocation Loc, SourceManager& SrcMgr, + unsigned DiagID) { + D.Report(FullSourceLoc(Loc,SrcMgr), DiagID); +} + +void DeclSpec::Diag(Diagnostic &D, SourceLocation Loc, SourceManager& SrcMgr, + unsigned DiagID, const std::string &info) { + D.Report(FullSourceLoc(Loc,SrcMgr), DiagID, &info, 1); +} diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 5b4473ea4d..e5c8fe7627 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "clang/Parse/Parser.h" +#include "clang/Basic/Diagnostic.h" #include "clang/Parse/DeclSpec.h" #include "clang/Parse/Scope.h" #include "llvm/ADT/SmallSet.h" diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index 05abfe1a77..7bd8b7b893 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "clang/Parse/Parser.h" +#include "clang/Basic/Diagnostic.h" #include "clang/Parse/DeclSpec.h" #include "clang/Parse/Scope.h" using namespace clang; diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 580c949ddd..d1cbdc8eeb 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -24,6 +24,7 @@ #include "clang/AST/Type.h" #include "clang/Parse/DeclSpec.h" #include "clang/Parse/Scope.h" +#include "clang/Basic/Diagnostic.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/TargetInfo.h" #include "clang/Basic/SourceManager.h" diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index c8bc12df9f..37b4e42274 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -13,6 +13,7 @@ #include "Sema.h" #include "clang/AST/ASTContext.h" +#include "clang/Basic/Diagnostic.h" #include "clang/Basic/TargetInfo.h" #include "clang/Parse/DeclSpec.h" #include diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index f68f82b87d..d49626c590 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -21,6 +21,7 @@ #include "clang/Parse/DeclSpec.h" #include "clang/Lex/Preprocessor.h" #include "clang/Lex/LiteralSupport.h" +#include "clang/Basic/Diagnostic.h" #include "clang/Basic/SourceManager.h" #include "clang/Basic/TargetInfo.h" #include "llvm/ADT/OwningPtr.h" diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index bda8932ef4..30af618c26 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -15,8 +15,9 @@ #include "clang/AST/ASTContext.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclObjC.h" -#include "clang/Parse/DeclSpec.h" +#include "clang/Basic/Diagnostic.h" #include "clang/Basic/LangOptions.h" +#include "clang/Parse/DeclSpec.h" using namespace clang; /// ConvertDeclSpecToType - Convert the specified declspec to the appropriate