[cfe-commits] r94210 - in /cfe/trunk/tools/CIndex: CIndex.cpp CIndexUSRs.cpp CIndexer.h CMakeLists.txt Makefile

Douglas Gregor dgregor at apple.com
Fri Jan 22 12:35:54 PST 2010


Author: dgregor
Date: Fri Jan 22 14:35:53 2010
New Revision: 94210

URL: http://llvm.org/viewvc/llvm-project?rev=94210&view=rev
Log:
Eliminate CIndex's dependency on the Clang Index library, since we
weren't actually using any of its facilities.

Modified:
    cfe/trunk/tools/CIndex/CIndex.cpp
    cfe/trunk/tools/CIndex/CIndexUSRs.cpp
    cfe/trunk/tools/CIndex/CIndexer.h
    cfe/trunk/tools/CIndex/CMakeLists.txt
    cfe/trunk/tools/CIndex/Makefile

Modified: cfe/trunk/tools/CIndex/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.cpp?rev=94210&r1=94209&r2=94210&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndex.cpp Fri Jan 22 14:35:53 2010
@@ -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)

Modified: cfe/trunk/tools/CIndex/CIndexUSRs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndexUSRs.cpp?rev=94210&r1=94209&r2=94210&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CIndexUSRs.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndexUSRs.cpp Fri Jan 22 14:35:53 2010
@@ -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.
 //===----------------------------------------------------------------------===//

Modified: cfe/trunk/tools/CIndex/CIndexer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndexer.h?rev=94210&r1=94209&r2=94210&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CIndexer.h (original)
+++ cfe/trunk/tools/CIndex/CIndexer.h Fri Jan 22 14:35:53 2010
@@ -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.

Modified: cfe/trunk/tools/CIndex/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CMakeLists.txt?rev=94210&r1=94209&r2=94210&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CMakeLists.txt (original)
+++ cfe/trunk/tools/CIndex/CMakeLists.txt Fri Jan 22 14:35:53 2010
@@ -3,8 +3,7 @@
 set(LLVM_NO_RTTI 1)
 
 set(LLVM_USED_LIBS
-  clangIndex
-  clangFrontend
+ clangFrontend
   clangDriver
   clangSema
   clangAnalysis

Modified: cfe/trunk/tools/CIndex/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/Makefile?rev=94210&r1=94209&r2=94210&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/Makefile (original)
+++ cfe/trunk/tools/CIndex/Makefile Fri Jan 22 14:35:53 2010
@@ -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





More information about the cfe-commits mailing list