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 9171c9e..d7b6f39 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 d11b8df..c61197f 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 bcf066d..3db37b9 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 79a5df0..919c21c 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<typename T> 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 4a884e5..e863239 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 a2be617..b049c96 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 0774ae2..d5131ff 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 1fa3ca9..31bf779 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 <vector>
 
-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 8bfc6f9..66566c1 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 {