hvdijk created this revision.
hvdijk added reviewers: sammccall, usaxena95.
hvdijk added a project: clang-tools-extra.
Herald added subscribers: kadircet, arphaman, mgorny.
hvdijk requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
The current code accounts for two possible layouts, but there is at least a
third supported layout: clang-tools-extra may also be checked out as
clang/tools/extra with the releases, which was not yet handled. Rather than
treating that as a special case, use the location of CompletionModel.cmake to
handle all three cases. This should address the problems that prompted D96787
<https://reviews.llvm.org/D96787> and the problems that prompted the proposed
revert D100625 <https://reviews.llvm.org/D100625>.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D101851
Files:
clang-tools-extra/clangd/quality/CompletionModel.cmake
Index: clang-tools-extra/clangd/quality/CompletionModel.cmake
===================================================================
--- clang-tools-extra/clangd/quality/CompletionModel.cmake
+++ clang-tools-extra/clangd/quality/CompletionModel.cmake
@@ -4,8 +4,9 @@
# ${CMAKE_CURRENT_BINARY_DIR}. The generated header
# will define a C++ class called ${cpp_class} - which may be a
# namespace-qualified class name.
+set(CLANGD_QUALITY_DIR ${CMAKE_CURRENT_LIST_DIR})
function(gen_decision_forest model filename cpp_class)
- set(model_compiler
${LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR}/clangd/quality/CompletionModelCodegen.py)
+ set(model_compiler ${CLANGD_QUALITY_DIR}/CompletionModelCodegen.py)
set(output_dir ${CMAKE_CURRENT_BINARY_DIR})
set(header_file ${output_dir}/${filename}.h)
Index: clang-tools-extra/clangd/quality/CompletionModel.cmake
===================================================================
--- clang-tools-extra/clangd/quality/CompletionModel.cmake
+++ clang-tools-extra/clangd/quality/CompletionModel.cmake
@@ -4,8 +4,9 @@
# ${CMAKE_CURRENT_BINARY_DIR}. The generated header
# will define a C++ class called ${cpp_class} - which may be a
# namespace-qualified class name.
+set(CLANGD_QUALITY_DIR ${CMAKE_CURRENT_LIST_DIR})
function(gen_decision_forest model filename cpp_class)
- set(model_compiler ${LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR}/clangd/quality/CompletionModelCodegen.py)
+ set(model_compiler ${CLANGD_QUALITY_DIR}/CompletionModelCodegen.py)
set(output_dir ${CMAKE_CURRENT_BINARY_DIR})
set(header_file ${output_dir}/${filename}.h)
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits