Eliminate CIndex's dependency on the Clang Index library, since we
weren't actually using any of its facilities.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94210 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp
index 3447553..78fdace 100644
--- a/tools/CIndex/CIndex.cpp
+++ b/tools/CIndex/CIndex.cpp
@@ -834,7 +834,7 @@
extern "C" {
CXIndex clang_createIndex(int excludeDeclarationsFromPCH,
int displayDiagnostics) {
- CIndexer *CIdxr = new CIndexer(new Program());
+ CIndexer *CIdxr = new CIndexer();
if (excludeDeclarationsFromPCH)
CIdxr->setOnlyLocalDecls();
if (displayDiagnostics)
diff --git a/tools/CIndex/CIndexUSRs.cpp b/tools/CIndex/CIndexUSRs.cpp
index e7f8529..fd605fb 100644
--- a/tools/CIndex/CIndexUSRs.cpp
+++ b/tools/CIndex/CIndexUSRs.cpp
@@ -17,10 +17,6 @@
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/raw_ostream.h"
-static inline Program &GetProgram(CXIndex CIdx) {
- return ((CIndexer*) CIdx)->getProgram();
-}
-
//===----------------------------------------------------------------------===//
// USR generation.
//===----------------------------------------------------------------------===//
diff --git a/tools/CIndex/CIndexer.h b/tools/CIndex/CIndexer.h
index 4f3cd8b..1a4e4b7 100644
--- a/tools/CIndex/CIndexer.h
+++ b/tools/CIndex/CIndexer.h
@@ -16,10 +16,6 @@
#define LLVM_CLANG_CINDEXER_H
#include "clang-c/Index.h"
-#include "clang/Index/ASTLocation.h"
-#include "clang/Index/Indexer.h"
-#include "clang/Index/Program.h"
-#include "clang/Index/Utils.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/ASTUnit.h"
#include "llvm/System/Path.h"
@@ -34,7 +30,7 @@
virtual void HandleDiagnostic(Diagnostic::Level, const DiagnosticInfo &) {}
};
-class CIndexer : public Indexer {
+class CIndexer {
DiagnosticOptions DiagOpts;
IgnoreDiagnosticsClient IgnoreDiagClient;
llvm::OwningPtr<Diagnostic> TextDiags;
@@ -46,16 +42,12 @@
llvm::sys::Path ClangPath;
public:
- explicit CIndexer(Program *prog) : Indexer(*prog),
- IgnoreDiags(&IgnoreDiagClient),
- UseExternalASTGeneration(false),
- OnlyLocalDecls(false),
- DisplayDiagnostics(false) {
+ CIndexer() : IgnoreDiags(&IgnoreDiagClient), UseExternalASTGeneration(false),
+ OnlyLocalDecls(false), DisplayDiagnostics(false)
+ {
TextDiags.reset(CompilerInstance::createDiagnostics(DiagOpts, 0, 0));
}
- virtual ~CIndexer() { delete &getProgram(); }
-
/// \brief Whether we only want to see "local" declarations (that did not
/// come from a previous precompiled header). If false, we want to see all
/// declarations.
diff --git a/tools/CIndex/CMakeLists.txt b/tools/CIndex/CMakeLists.txt
index c667df6..730eaaf 100644
--- a/tools/CIndex/CMakeLists.txt
+++ b/tools/CIndex/CMakeLists.txt
@@ -3,8 +3,7 @@
set(LLVM_NO_RTTI 1)
set(LLVM_USED_LIBS
- clangIndex
- clangFrontend
+ clangFrontend
clangDriver
clangSema
clangAnalysis
diff --git a/tools/CIndex/Makefile b/tools/CIndex/Makefile
index 94f0467..7bdbba1 100644
--- a/tools/CIndex/Makefile
+++ b/tools/CIndex/Makefile
@@ -22,7 +22,7 @@
SHARED_LIBRARY = 1
LINK_COMPONENTS := bitreader mc core
-USEDLIBS = clangIndex.a clangFrontend.a clangDriver.a clangSema.a \
+USEDLIBS = clangFrontend.a clangDriver.a clangSema.a \
clangAnalysis.a clangAST.a clangParse.a clangLex.a clangBasic.a
include $(LEVEL)/Makefile.common