[PATCH] D136283: [clang-tools-extra] [clangd] Split huge generated CompletionModel.cpp into smaller files

Arfrever Frehtes Taifersar Arahesis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 6 07:15:10 PST 2022


Arfrever added inline comments.


================
Comment at: clang-tools-extra/clangd/quality/CompletionModel.cmake:25
+
+  file(GLOB cpp_files "${output_dir}/${filename}*.cpp")
+
----------------
thakis wrote:
> Can we list them? We try not to use globs in cmakelists.txt files.
This `gen_decision_forest()` function is called from 2 places (`clang-tools-extra/clangd/CMakeLists.txt`, `clang-tools-extra/clangd/unittests/CMakeLists.txt`), on different models, so this is impossible to do, at least in this file (`clang-tools-extra/clangd/quality/CompletionModel.cmake`).

And hardcoding of list of files in those `CMakeLists.txt` files would be inflexible and more fragile, since `gen_decision_forest(${CMAKE_CURRENT_SOURCE_DIR}/quality/model CompletionModel ...)` generates 301 `.cpp` files (1 file for each of 300 trees: `CompletionModel0.cpp`, `CompletionModel1.cpp`, ... until `CompletionModel299.cpp`, and 1 file for final function: `CompletionModel.cpp`).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136283/new/

https://reviews.llvm.org/D136283



More information about the cfe-commits mailing list