[PATCH] D53292: [clangd] Add createIndex in dexp
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=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 -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}, }; +std::unique_ptr 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 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; } 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 -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}, }; +std::unique_ptr 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 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; } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D53292: [clangd] Add createIndex in dexp
hokein updated this revision to Diff 169712. hokein marked 2 inline comments as done. hokein added a comment. createIndex => openIndex 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 -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}, }; +std::unique_ptr 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 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; } 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 -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}, }; +std::unique_ptr 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 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; } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D53292: [clangd] Add createIndex in dexp
sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land. Comment at: clangd/index/dex/dexp/Dexp.cpp:256 +std::unique_ptr createIndex(llvm::StringRef Index) { + return loadIndex(Index, /*URISchemes=*/{}, /*UseDex=*/true); createIndex seems a slightly odd name for this (as if writing new files or adding new data somehow): openIndex or so? Comment at: clangd/index/dex/dexp/Dexp.cpp:273 if (!Index) { -llvm::outs() -<< "ERROR: Please provide a valid path to symbol collection file.\n"; +llvm::outs() << "Failed to create an index.\n"; return -1; "to open the index"? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D53292: [clangd] Add createIndex in dexp
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. This would allow easily injecting our internal customization. Also updates the stale "symbol-collection-file" flag. 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 -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}, }; +std::unique_ptr createIndex(llvm::StringRef Index) { + return loadIndex(Index, /*URISchemes=*/{}, /*UseDex=*/true); +} + } // namespace int main(int argc, const char *argv[]) { @@ -262,13 +266,11 @@ std::unique_ptr Index; reportTime("Dex build", [&]() { -Index = loadIndex(SymbolCollection, /*URISchemes=*/{}, - /*UseDex=*/true); +Index = createIndex(IndexPath); }); if (!Index) { -llvm::outs() -<< "ERROR: Please provide a valid path to symbol collection file.\n"; +llvm::outs() << "Failed to create an index.\n"; return -1; } 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 -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}, }; +std::unique_ptr createIndex(llvm::StringRef Index) { + return loadIndex(Index, /*URISchemes=*/{}, /*UseDex=*/true); +} + } // namespace int main(int argc, const char *argv[]) { @@ -262,13 +266,11 @@ std::unique_ptr Index; reportTime("Dex build", [&]() { -Index = loadIndex(SymbolCollection, /*URISchemes=*/{}, - /*UseDex=*/true); +Index = createIndex(IndexPath); }); if (!Index) { -llvm::outs() -<< "ERROR: Please provide a valid path to symbol collection file.\n"; +llvm::outs() << "Failed to create an index.\n"; return -1; } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits