diff options
-rw-r--r-- | tools/CIndex/CIndex.cpp | 2 | ||||
-rw-r--r-- | tools/CIndex/CIndexUSRs.cpp | 4 | ||||
-rw-r--r-- | tools/CIndex/CIndexer.h | 16 | ||||
-rw-r--r-- | tools/CIndex/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tools/CIndex/Makefile | 2 |
5 files changed, 7 insertions, 20 deletions
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp index 3447553ae3..78fdaceb2c 100644 --- a/tools/CIndex/CIndex.cpp +++ b/tools/CIndex/CIndex.cpp @@ -834,7 +834,7 @@ CXString CIndexer::createCXString(const char *String, bool DupString){ 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 e7f8529002..fd605fb68d 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 4f3cd8b85f..1a4e4b7b8f 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 @@ public: 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 @@ class CIndexer : public Indexer { 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 c667df622f..730eaafb5a 100644 --- a/tools/CIndex/CMakeLists.txt +++ b/tools/CIndex/CMakeLists.txt @@ -3,8 +3,7 @@ set(SHARED_LIBRARY TRUE) 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 94f0467000..7bdbba172f 100644 --- a/tools/CIndex/Makefile +++ b/tools/CIndex/Makefile @@ -22,7 +22,7 @@ LINK_LIBS_IN_SHARED = 1 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 |