[PATCH] D53292: [clangd] Add createIndex in dexp

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 15 08:14:59 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE344521: [clangd] Add createIndex in dexp (authored by hokein, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D53292?vs=169712&id=169713#toc

Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53292

Files:
  clangd/index/dex/dexp/Dexp.cpp


Index: clangd/index/dex/dexp/Dexp.cpp
===================================================================
--- clangd/index/dex/dexp/Dexp.cpp
+++ clangd/index/dex/dexp/Dexp.cpp
@@ -31,9 +31,9 @@
 namespace {
 
 llvm::cl::opt<std::string>
-    SymbolCollection("symbol-collection-file",
-                     llvm::cl::desc("Path to the file with symbol collection"),
-                     llvm::cl::Positional, llvm::cl::Required);
+    IndexPath("index-path",
+              llvm::cl::desc("Path to the index"),
+              llvm::cl::Positional, llvm::cl::Required);
 
 static const std::string Overview = R"(
 This is an **experimental** interactive tool to process user-provided search
@@ -253,6 +253,10 @@
      llvm::make_unique<Refs>},
 };
 
+std::unique_ptr<SymbolIndex> openIndex(llvm::StringRef Index) {
+  return loadIndex(Index, /*URISchemes=*/{}, /*UseDex=*/true);
+}
+
 } // namespace
 
 int main(int argc, const char *argv[]) {
@@ -262,13 +266,11 @@
 
   std::unique_ptr<SymbolIndex> Index;
   reportTime("Dex build", [&]() {
-    Index = loadIndex(SymbolCollection, /*URISchemes=*/{},
-                      /*UseDex=*/true);
+    Index = openIndex(IndexPath);
   });
 
   if (!Index) {
-    llvm::outs()
-        << "ERROR: Please provide a valid path to symbol collection file.\n";
+    llvm::outs() << "Failed to open the index.\n";
     return -1;
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53292.169713.patch
Type: text/x-patch
Size: 1376 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181015/6c113904/attachment.bin>


More information about the cfe-commits mailing list