[PATCH] D49785: [clangd] Give an example for global-symbol-builder usage
Kirill Bobyrev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 25 07:31:33 PDT 2018
kbobyrev updated this revision to Diff 157263.
kbobyrev marked 2 inline comments as done.
kbobyrev added a comment.
Addressed two comments, added an example of running the tool over a number of source files without providing `compile_commands.json`; added a note about collecting files from headers only.
https://reviews.llvm.org/D49785
Files:
clang-tools-extra/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp
Index: clang-tools-extra/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp
===================================================================
--- clang-tools-extra/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp
+++ clang-tools-extra/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp
@@ -150,10 +150,23 @@
int main(int argc, const char **argv) {
llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);
- const char* Overview =
- "This is an **experimental** tool to generate YAML-format "
- "project-wide symbols for clangd (global code completion). It would be "
- "changed and deprecated eventually. Don't use it in production code!";
+ const char *Overview = R"(
+ This is an **experimental** tool to generate YAML-format project-wide symbols
+ for clangd (global code completion). It would be changed and deprecated
+ eventually. Don't use it in production code!
+
+ Example usage for building index for the whole project using CMake compile
+ commands:
+
+ $ global-symbol-builder --executor=all-TUs compile_commands.json > index.yaml
+
+ Example usage for file sequence index without flags:
+
+ $ global-symbol-builder File1.cpp File2.cpp ... FileN.cpp > index.yaml
+
+ Note: only symbols from header files will be collected.
+ )";
+
auto Executor = clang::tooling::createExecutorFromCommandLineArgs(
argc, argv, cl::GeneralCategory, Overview);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49785.157263.patch
Type: text/x-patch
Size: 1414 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180725/22c226d7/attachment.bin>
More information about the cfe-commits
mailing list