From: Benjamin Kramer Date: Mon, 12 Apr 2010 19:45:50 +0000 (+0000) Subject: Prune includes. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b846debc1b22a37228efe4aa87b34482d15b6a3c;p=clang Prune includes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101059 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp index 9171c9ee84..d7b6f39bbe 100644 --- a/tools/CIndex/CIndex.cpp +++ b/tools/CIndex/CIndex.cpp @@ -22,8 +22,12 @@ #include "clang/AST/DeclVisitor.h" #include "clang/AST/StmtVisitor.h" #include "clang/AST/TypeLocVisitor.h" +#include "clang/Basic/Diagnostic.h" +#include "clang/Frontend/ASTUnit.h" +#include "clang/Frontend/CompilerInstance.h" #include "clang/Frontend/FrontendDiagnostic.h" #include "clang/Lex/Lexer.h" +#include "clang/Lex/PreprocessingRecord.h" #include "clang/Lex/Preprocessor.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/System/Program.h" @@ -35,7 +39,6 @@ using namespace clang; using namespace clang::cxcursor; using namespace clang::cxstring; -using namespace idx; //===----------------------------------------------------------------------===// // Crash Reporting. diff --git a/tools/CIndex/CIndexCodeCompletion.cpp b/tools/CIndex/CIndexCodeCompletion.cpp index d11b8dfb50..c61197fc9b 100644 --- a/tools/CIndex/CIndexCodeCompletion.cpp +++ b/tools/CIndex/CIndexCodeCompletion.cpp @@ -14,6 +14,9 @@ #include "CIndexer.h" #include "CIndexDiagnostic.h" +#include "clang/Basic/SourceManager.h" +#include "clang/Basic/FileManager.h" +#include "clang/Frontend/CompilerInstance.h" #include "clang/Frontend/FrontendDiagnostic.h" #include "clang/Sema/CodeCompleteConsumer.h" #include "llvm/ADT/StringExtras.h" diff --git a/tools/CIndex/CIndexDiagnostic.cpp b/tools/CIndex/CIndexDiagnostic.cpp index bcf066daf2..3db37b97da 100644 --- a/tools/CIndex/CIndexDiagnostic.cpp +++ b/tools/CIndex/CIndexDiagnostic.cpp @@ -14,6 +14,7 @@ #include "CIndexer.h" #include "CXSourceLocation.h" +#include "clang/Frontend/ASTUnit.h" #include "clang/Frontend/FrontendDiagnostic.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/Twine.h" diff --git a/tools/CIndex/CIndexDiagnostic.h b/tools/CIndex/CIndexDiagnostic.h index 79a5df0381..919c21cfdb 100644 --- a/tools/CIndex/CIndexDiagnostic.h +++ b/tools/CIndex/CIndexDiagnostic.h @@ -13,20 +13,21 @@ #ifndef LLVM_CLANG_CINDEX_DIAGNOSTIC_H #define LLVM_CLANG_CINDEX_DIAGNOSTIC_H -#include "clang-c/Index.h" -#include "clang/Basic/Diagnostic.h" -#include "clang/Basic/LangOptions.h" -#include "llvm/ADT/SmallVector.h" +struct CXUnsavedFile; -namespace llvm { namespace sys { -class Path; -} } +namespace llvm { +template class SmallVectorImpl; +namespace sys { class Path; } +} namespace clang { class Diagnostic; +class FileManager; class LangOptions; class Preprocessor; +class StoredDiagnostic; +class SourceManager; /// \brief The storage behind a CXDiagnostic struct CXStoredDiagnostic { diff --git a/tools/CIndex/CIndexInclusionStack.cpp b/tools/CIndex/CIndexInclusionStack.cpp index 4a884e5884..e86323956f 100644 --- a/tools/CIndex/CIndexInclusionStack.cpp +++ b/tools/CIndex/CIndexInclusionStack.cpp @@ -15,8 +15,10 @@ #include "CIndexer.h" #include "CXSourceLocation.h" #include "clang/AST/DeclVisitor.h" +#include "clang/Frontend/ASTUnit.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/raw_ostream.h" +using namespace clang; extern "C" { void clang_getInclusions(CXTranslationUnit TU, CXInclusionVisitor CB, diff --git a/tools/CIndex/CIndexUSRs.cpp b/tools/CIndex/CIndexUSRs.cpp index a2be617d8a..b049c96b48 100644 --- a/tools/CIndex/CIndexUSRs.cpp +++ b/tools/CIndex/CIndexUSRs.cpp @@ -14,9 +14,10 @@ #include "CIndexer.h" #include "CXCursor.h" #include "clang/AST/DeclVisitor.h" +#include "clang/Lex/PreprocessingRecord.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/raw_ostream.h" - +using namespace clang; using namespace clang::cxstring; //===----------------------------------------------------------------------===// diff --git a/tools/CIndex/CIndexer.cpp b/tools/CIndex/CIndexer.cpp index 0774ae2f37..d5131ff6d8 100644 --- a/tools/CIndex/CIndexer.cpp +++ b/tools/CIndex/CIndexer.cpp @@ -38,7 +38,6 @@ #endif using namespace clang; -using namespace idx; const llvm::sys::Path& CIndexer::getClangPath() { // Did we already compute the path? diff --git a/tools/CIndex/CIndexer.h b/tools/CIndex/CIndexer.h index 1fa3ca9387..31bf779ea4 100644 --- a/tools/CIndex/CIndexer.h +++ b/tools/CIndex/CIndexer.h @@ -16,14 +16,10 @@ #define LLVM_CLANG_CINDEXER_H #include "clang-c/Index.h" -#include "clang/Frontend/CompilerInstance.h" -#include "clang/Frontend/ASTUnit.h" #include "llvm/ADT/StringRef.h" #include "llvm/System/Path.h" #include -using namespace clang; - namespace clang { namespace cxstring { CXString createCXString(const char *String, bool DupString = false); diff --git a/tools/CIndex/CXSourceLocation.h b/tools/CIndex/CXSourceLocation.h index 8bfc6f9da7..66566c1268 100644 --- a/tools/CIndex/CXSourceLocation.h +++ b/tools/CIndex/CXSourceLocation.h @@ -16,13 +16,12 @@ #include "clang-c/Index.h" #include "clang/Basic/SourceLocation.h" -#include "clang/Basic/SourceManager.h" #include "clang/Basic/LangOptions.h" #include "clang/AST/ASTContext.h" namespace clang { - -class ASTContext; + +class SourceManager; namespace cxloc {