[llvm] 929d91a - [gn build] (manually) port 9b6765e784b3 more

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 18 12:56:50 PDT 2020


Author: Nico Weber
Date: 2020-09-18T15:56:34-04:00
New Revision: 929d91a55616d4fcf4754044b063644807b87fbe

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

LOG: [gn build] (manually) port 9b6765e784b3 more

Added: 
    

Modified: 
    llvm/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn
    llvm/utils/gn/secondary/clang-tools-extra/clangd/unittests/BUILD.gn

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn
index 2fc2d0e260074..20309f35d85ac 100644
--- a/llvm/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn
@@ -1,3 +1,4 @@
+import("//clang-tools-extra/clangd/quality/gen_decision_forest.gni")
 import("//clang-tools-extra/clangd/xpc/enable.gni")
 import("//llvm/utils/gn/build/write_cmake_config.gni")
 
@@ -20,35 +21,10 @@ write_cmake_config("features") {
   public_configs = [ ":features_config" ]
 }
 
-action("CompletionModelCpp") {
-  script = "quality/CompletionModelCodegen.py"
-  outputs = [
-    "$target_gen_dir/CompletionModel.cpp",
-    "$target_gen_dir/CompletionModel.h",
-  ]
-  args = [
-    "--model",
-    rebase_path("quality/model", root_build_dir),
-    "--output_dir",
-    rebase_path(target_gen_dir, root_build_dir),
-    "--filename",
-    "CompletionModel",
-    "--cpp_class",
-    "clang::clangd::Example",
-  ]
-}
-
-config("CompletionModelConfig") {
-  cflags = [ "-Wno-unused-label" ]
-}
-
-source_set("CompletionModel") {
-  configs += [
-    "//llvm/utils/gn/build:clang_code",
-    ":CompletionModelConfig",
-  ]
-  deps = [ ":CompletionModelCpp" ]
-  sources = get_target_outputs(":CompletionModelCpp")
+gen_decision_forest("CompletionModel") {
+  model = "quality/model"
+  filename = "CompletionModel"
+  cpp_class = "clang::clangd::Example"
 }
 
 static_library("clangd") {

diff  --git a/llvm/utils/gn/secondary/clang-tools-extra/clangd/unittests/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/clangd/unittests/BUILD.gn
index f732e837a88ef..409eaf8105a1d 100644
--- a/llvm/utils/gn/secondary/clang-tools-extra/clangd/unittests/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang-tools-extra/clangd/unittests/BUILD.gn
@@ -1,8 +1,16 @@
+import("//clang-tools-extra/clangd/quality/gen_decision_forest.gni")
 import("//llvm/utils/unittest/unittest.gni")
 
+gen_decision_forest("DecisionForestRuntimeTest") {
+  model = "decision_forest_model"
+  filename = "DecisionForestRuntimeTest"
+  cpp_class = "::ns1::ns2::test::Example"
+}
+
 unittest("ClangdTests") {
   configs += [ "//llvm/utils/gn/build:clang_code" ]
   deps = [
+    ":DecisionForestRuntimeTest",
     "//clang-tools-extra/clang-tidy",
     "//clang-tools-extra/clangd",
     "//clang-tools-extra/clangd:features",
@@ -28,6 +36,9 @@ unittest("ClangdTests") {
 
     # To pick up the generated inc files.
     "$target_gen_dir/../../clangd/tool",
+
+    # To pick up the generated DecisionForestRuntimeTest.h file.
+    target_gen_dir,
   ]
   sources = [
     "ASTTests.cpp",
@@ -44,6 +55,7 @@ unittest("ClangdTests") {
     "ConfigCompileTests.cpp",
     "ConfigProviderTests.cpp",
     "ConfigYAMLTests.cpp",
+    "DecisionForestTests.cpp",
     "DexTests.cpp",
     "DiagnosticsTests.cpp",
     "DraftStoreTests.cpp",


        


More information about the llvm-commits mailing list