[llvm-branch-commits] [clang-tools-extra] adae177 - Make clangd CompletionModel not depend on directory layout.

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jun 14 11:23:10 PDT 2021


Author: Harald van Dijk
Date: 2021-06-14T14:22:25-04:00
New Revision: adae17728bad62fa9ce1635905d0b0bde30e3eba

URL: https://github.com/llvm/llvm-project/commit/adae17728bad62fa9ce1635905d0b0bde30e3eba
DIFF: https://github.com/llvm/llvm-project/commit/adae17728bad62fa9ce1635905d0b0bde30e3eba.diff

LOG: Make clangd CompletionModel not depend on directory layout.

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 and the problems that prompted the
proposed revert D100625.

Reviewed By: usaxena95

Differential Revision: https://reviews.llvm.org/D101851

(cherry picked from commit 7907c46fe6195728fafd843b8c0fb19a3e68e9ad)

Added: 
    

Modified: 
    clang-tools-extra/clangd/quality/CompletionModel.cmake

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/quality/CompletionModel.cmake b/clang-tools-extra/clangd/quality/CompletionModel.cmake
index 41bc2ed1890b0..dc0c0cde4dabb 100644
--- a/clang-tools-extra/clangd/quality/CompletionModel.cmake
+++ b/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_COMPLETION_MODEL_COMPILER ${CMAKE_CURRENT_LIST_DIR}/CompletionModelCodegen.py)
 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_COMPLETION_MODEL_COMPILER})
 
   set(output_dir ${CMAKE_CURRENT_BINARY_DIR})
   set(header_file ${output_dir}/${filename}.h)


        


More information about the llvm-branch-commits mailing list