[PATCH] D41491: [clangd] Add a tool to build YAML-format global symbols.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 22 05:06:59 PST 2017


sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

Thanks for the simplification!
How long does it take to run over LLVM on your machine?



================
Comment at: clangd/CMakeLists.txt:50
 add_subdirectory(tool)
+add_subdirectory(global-symbol-builder)
----------------
hokein wrote:
> sammccall wrote:
> > I think generally we run `check-clang-tools` before committing - I guess it's OK not to have tests for this experimental tool, but we should at least keep it building. Can you make check-clang-tools build it?
> Yeah, it builds.
Can you add it to the deps of the testsuite, so we don't break it?


================
Comment at: clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp:45
+    IndexOpts.SystemSymbolFilter =
+        index::IndexingOptions::SystemSymbolFilterKind::All;
+    IndexOpts.IndexFunctionLocals = false;
----------------
out of curiosity, what does this do?


================
Comment at: clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp:57
+
+static cl::OptionCategory GlobalSymbolCategory("global-symbol-builder options");
+
----------------
you could avoid opt parsing, opening files and dealing with errors etc by just writing to llvm::outs() and running with > foo.yaml - up to you


================
Comment at: clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp:90
+  if (OptionsParser.getCompilations().getAllFiles().empty()) {
+    ClangTool Tool(OptionsParser.getCompilations(),
+                   OptionsParser.getSourcePathList());
----------------
if this isn't the typical use case, consider
llvm::errs() << "No compilation database found, processing individual files with flags from command-line\n"


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D41491





More information about the cfe-commits mailing list