[llvm] aa5eff9 - [gn] port ed8f78827895 (rm clang-pseudo)
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 19 06:27:31 PDT 2024
Author: Nico Weber
Date: 2024-09-19T09:26:58-04:00
New Revision: aa5eff9ee32d20dcc20d59bb0cc65b4830fecaf6
URL: https://github.com/llvm/llvm-project/commit/aa5eff9ee32d20dcc20d59bb0cc65b4830fecaf6
DIFF: https://github.com/llvm/llvm-project/commit/aa5eff9ee32d20dcc20d59bb0cc65b4830fecaf6.diff
LOG: [gn] port ed8f78827895 (rm clang-pseudo)
Added:
Modified:
llvm/utils/gn/secondary/BUILD.gn
llvm/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn
llvm/utils/gn/secondary/clang-tools-extra/pseudo/gen/BUILD.gn
llvm/utils/gn/secondary/clang-tools-extra/pseudo/include/BUILD.gn
llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/BUILD.gn
llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/cli/BUILD.gn
llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/cxx/BUILD.gn
llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/grammar/BUILD.gn
llvm/utils/gn/secondary/clang-tools-extra/pseudo/test/BUILD.gn
llvm/utils/gn/secondary/clang-tools-extra/pseudo/test/clang_pseudo_lit_site_cfg_files.gni
llvm/utils/gn/secondary/clang-tools-extra/pseudo/tool/BUILD.gn
llvm/utils/gn/secondary/clang-tools-extra/pseudo/unittests/BUILD.gn
llvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn
Removed:
################################################################################
diff --git a/llvm/utils/gn/secondary/BUILD.gn b/llvm/utils/gn/secondary/BUILD.gn
index af7f1e8f1f78f3..a17a2fdb7a3ca5 100644
--- a/llvm/utils/gn/secondary/BUILD.gn
+++ b/llvm/utils/gn/secondary/BUILD.gn
@@ -5,7 +5,6 @@ import("//llvm/utils/gn/build/toolchain/compiler.gni")
group("default") {
deps = [
"//clang-tools-extra/clangd/test",
- "//clang-tools-extra/pseudo/test",
"//clang-tools-extra/test",
"//clang/test",
"//clang/tools/scan-build",
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 e3126f9f057417..a116c0abe0b2cc 100644
--- a/llvm/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn
@@ -44,7 +44,6 @@ static_library("clangd") {
"//clang-tools-extra/clang-tidy:clang-tidy-config",
"//clang-tools-extra/clangd/support",
"//clang-tools-extra/include-cleaner/lib",
- "//clang-tools-extra/pseudo/lib",
"//clang/lib/AST",
"//clang/lib/ASTMatchers",
"//clang/lib/Basic",
@@ -73,9 +72,6 @@ static_library("clangd") {
# For "clang-include-cleaner/..." includes.
"//clang-tools-extra/include-cleaner/include",
- # For "clang-pseudo/..." includes.
- "//clang-tools-extra/pseudo/include",
-
# To pick up the generated inc files.
"$target_gen_dir/tool",
]
diff --git a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/gen/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/gen/BUILD.gn
index 0e4076bd142f01..e69de29bb2d1d6 100644
--- a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/gen/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/gen/BUILD.gn
@@ -1,9 +0,0 @@
-executable("clang-pseudo-gen") {
- configs += [ "//llvm/utils/gn/build:clang_code" ]
- deps = [
- "//clang-tools-extra/pseudo/lib/grammar",
- "//llvm/lib/Support",
- ]
- include_dirs = [ "../include" ]
- sources = [ "Main.cpp" ]
-}
diff --git a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/include/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/include/BUILD.gn
index a38d7d0a5e72a6..e69de29bb2d1d6 100644
--- a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/include/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/include/BUILD.gn
@@ -1,39 +0,0 @@
-import("//llvm/utils/gn/build/compiled_action.gni")
-
-template("gen") {
- compiled_action(target_name) {
- tool = "//clang-tools-extra/pseudo/gen:clang-pseudo-gen"
- inputs = [ "../lib/cxx/cxx.bnf" ]
- outputs = [ "$target_gen_dir/$target_name" ]
- args = [
- "--grammar",
- rebase_path(inputs[0], root_build_dir),
- "-o",
- rebase_path(outputs[0], root_build_dir),
- invoker.flag,
- ]
- }
-}
-
-gen("CXXSymbols.inc") {
- flag = "--emit-symbol-list"
-}
-
-gen("CXXBNF.inc") {
- flag = "--emit-grammar-content"
-}
-
-config("cxx_gen_config") {
- visibility = [ ":cxx_gen" ]
- include_dirs = [ target_gen_dir ]
-}
-
-group("cxx_gen") {
- deps = [
- ":CXXBNF.inc",
- ":CXXSymbols.inc",
- ]
-
- # Let targets depending on this find the generated files.
- public_configs = [ ":cxx_gen_config" ]
-}
diff --git a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/BUILD.gn
index ee5cd10df92e5c..e69de29bb2d1d6 100644
--- a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/BUILD.gn
@@ -1,20 +0,0 @@
-static_library("lib") {
- output_name = "clangPseudo"
- configs += [ "//llvm/utils/gn/build:clang_code" ]
- deps = [
- "//clang-tools-extra/pseudo/lib/grammar",
- "//clang/lib/Basic",
- "//clang/lib/Lex",
- "//llvm/lib/Support",
- ]
- include_dirs = [ "../include" ]
- sources = [
- "Bracket.cpp",
- "DirectiveTree.cpp",
- "Disambiguate.cpp",
- "Forest.cpp",
- "GLR.cpp",
- "Lex.cpp",
- "Token.cpp",
- ]
-}
diff --git a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/cli/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/cli/BUILD.gn
index 80c748dc12da2b..e69de29bb2d1d6 100644
--- a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/cli/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/cli/BUILD.gn
@@ -1,11 +0,0 @@
-static_library("cli") {
- output_name = "clangPseudoCLI"
- configs += [ "//llvm/utils/gn/build:clang_code" ]
- deps = [
- "//clang-tools-extra/pseudo/lib/cxx",
- "//clang-tools-extra/pseudo/lib/grammar",
- "//llvm/lib/Support",
- ]
- include_dirs = [ "../../include" ]
- sources = [ "CLI.cpp" ]
-}
diff --git a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/cxx/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/cxx/BUILD.gn
index 3db60e29bc7a86..e69de29bb2d1d6 100644
--- a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/cxx/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/cxx/BUILD.gn
@@ -1,13 +0,0 @@
-static_library("cxx") {
- output_name = "clangPseudoCXX"
- configs += [ "//llvm/utils/gn/build:clang_code" ]
- deps = [
- "//clang-tools-extra/pseudo/lib/grammar",
- "//llvm/lib/Support",
- ]
-
- # public_deps because this target's public headers include generated headers.
- public_deps = [ "//clang-tools-extra/pseudo/include:cxx_gen" ]
- include_dirs = [ "../../include" ]
- sources = [ "CXX.cpp" ]
-}
diff --git a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/grammar/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/grammar/BUILD.gn
index df9f2ca2132bf5..e69de29bb2d1d6 100644
--- a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/grammar/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/lib/grammar/BUILD.gn
@@ -1,16 +0,0 @@
-static_library("grammar") {
- output_name = "clangPseudoGrammar"
- configs += [ "//llvm/utils/gn/build:clang_code" ]
- deps = [
- "//clang/include/clang/Basic:RegularKeywordAttrInfo",
- "//llvm/lib/Support",
- ]
- include_dirs = [ "../../include" ]
- sources = [
- "Grammar.cpp",
- "GrammarBNF.cpp",
- "LRGraph.cpp",
- "LRTable.cpp",
- "LRTableBuild.cpp",
- ]
-}
diff --git a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/test/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/test/BUILD.gn
index 13c6cdc8045d35..e69de29bb2d1d6 100644
--- a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/test/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/test/BUILD.gn
@@ -1,93 +0,0 @@
-import("//llvm/triples.gni")
-import("//llvm/utils/gn/build/write_cmake_config.gni")
-import("clang_pseudo_lit_site_cfg_files.gni")
-
-template("write_lit_config") {
- write_cmake_config(target_name) {
- input = invoker.input
- output = invoker.output
- values = [
- "LIT_SITE_CFG_IN_HEADER=## Autogenerated from $input, do not edit",
- "LLVM_LIBS_DIR=", # needed only for shared builds
- ]
- values += invoker.extra_values
- }
-}
-
-write_lit_config("lit_site_cfg") {
- # Fully-qualified instead of relative for LIT_SITE_CFG_IN_HEADER.
- input = "//clang-tools-extra/pseudo/test/lit.site.cfg.py.in"
- output = clang_pseudo_lit_site_cfg_file
-
- extra_values = [
- "CMAKE_CURRENT_BINARY_DIR=" +
- rebase_path(get_label_info("//clang-tools-extra/pseudo/test",
- "target_out_dir")),
- "CMAKE_CURRENT_SOURCE_DIR=" +
- rebase_path("//clang-tools-extra/pseudo/test"),
-
- "CURRENT_TOOLS_DIR=",
- "LLVM_LIT_TOOLS_DIR=", # Intentionally empty, matches cmake build.
- "LLVM_TOOLS_DIR=" + rebase_path("$root_out_dir/bin"),
- "TARGET_TRIPLE=$llvm_target_triple",
- "Python3_EXECUTABLE=$python_path",
- ]
-}
-
-write_lit_config("lit_unit_site_cfg") {
- # Fully-qualified instead of relative for LIT_SITE_CFG_IN_HEADER.
- input = "//clang-tools-extra/pseudo/test/Unit/lit.site.cfg.py.in"
- output = clang_pseudo_lit_unit_site_cfg_file
- extra_values = [
- "CMAKE_CURRENT_BINARY_DIR=" +
- rebase_path(get_label_info("//clang-tools-extra/pseudo/unittests",
- "target_out_dir")),
- "CMAKE_CURRENT_SOURCE_DIR=" +
- rebase_path("//clang-tools-extra/pseudo/test"),
- ]
- if (host_os == "win") {
- # See comment for Windows solink in llvm/utils/gn/build/toolchain/BUILD.gn
- extra_values += [ "SHLIBDIR=" + rebase_path("$root_out_dir/bin") ]
- } else {
- extra_values += [ "SHLIBDIR=" + rebase_path("$root_out_dir/lib") ]
- }
-}
-
-# This target should contain all dependencies of check-pseudo.
-# //:default depends on it, so that ninja's default target builds all
-# prerequisites for check-clang but doesn't run check-clang itself.
-group("test") {
- deps = [
- ":lit_site_cfg",
- ":lit_unit_site_cfg",
- "//clang-tools-extra/pseudo/tool:clang-pseudo",
- "//clang-tools-extra/pseudo/unittests:ClangPseudoTests",
- "//llvm/utils/FileCheck",
- "//llvm/utils/llvm-lit",
- "//llvm/utils/not",
- ]
- testonly = true
-}
-
-action("check-clang-pseudo") {
- script = "$root_out_dir/bin/llvm-lit"
- if (host_os == "win") {
- script += ".py"
- }
- args = [
- "-sv",
- rebase_path(get_path_info(clang_pseudo_lit_site_cfg_file, "dir"),
- root_out_dir),
- ]
- outputs = [ "$target_gen_dir/run-lit" ] # Non-existing, so that ninja runs it
- # each time.
-
- # Since check-clang-pseudo is always dirty, //:default doesn't depend on it so
- # that it's not part of the default ninja target. Hence, check-clang-pseudo
- # shouldn't have any deps except :test. so that the default target is sure to
- # build all the deps.
- deps = [ ":test" ]
- testonly = true
-
- pool = "//:console"
-}
diff --git a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/test/clang_pseudo_lit_site_cfg_files.gni b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/test/clang_pseudo_lit_site_cfg_files.gni
index ca469e54784428..e69de29bb2d1d6 100644
--- a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/test/clang_pseudo_lit_site_cfg_files.gni
+++ b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/test/clang_pseudo_lit_site_cfg_files.gni
@@ -1,4 +0,0 @@
-clang_pseudo_lit_site_cfg_file =
- "$root_gen_dir/clang-tools-extra/pseudo/test/lit.site.cfg.py"
-clang_pseudo_lit_unit_site_cfg_file =
- "$root_gen_dir/clang-tools-extra/pseudo/test/Unit/lit.site.cfg.py"
diff --git a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/tool/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/tool/BUILD.gn
index 829925534e8414..e69de29bb2d1d6 100644
--- a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/tool/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/tool/BUILD.gn
@@ -1,32 +0,0 @@
-action("HTMLForestResources") {
- script = "//clang/utils/bundle_resources.py"
- inputs = [
- "HTMLForest.css",
- "HTMLForest.js",
- "HTMLForest.html",
- ]
- outputs = [ "$target_gen_dir/HTMLForestResources.inc" ]
- args =
- rebase_path(outputs, root_build_dir) + rebase_path(inputs, root_build_dir)
-}
-
-executable("clang-pseudo") {
- configs += [ "//llvm/utils/gn/build:clang_code" ]
- deps = [
- ":HTMLForestResources",
- "//clang-tools-extra/pseudo/lib",
- "//clang-tools-extra/pseudo/lib/cli",
- "//clang/lib/Basic",
- "//llvm/lib/Support",
- ]
- include_dirs = [
- "../include",
-
- # To pick up HTMLForestResources.inc:
- target_gen_dir,
- ]
- sources = [
- "ClangPseudo.cpp",
- "HTMLForest.cpp",
- ]
-}
diff --git a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/unittests/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/unittests/BUILD.gn
index bf6b3048c813c5..e69de29bb2d1d6 100644
--- a/llvm/utils/gn/secondary/clang-tools-extra/pseudo/unittests/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang-tools-extra/pseudo/unittests/BUILD.gn
@@ -1,27 +0,0 @@
-import("//third-party/unittest/unittest.gni")
-
-unittest("ClangPseudoTests") {
- configs += [ "//llvm/utils/gn/build:clang_code" ]
- deps = [
- "//clang-tools-extra/pseudo/lib",
- "//clang-tools-extra/pseudo/lib/cxx",
- "//clang/lib/Basic",
- "//clang/lib/Lex",
- "//clang/lib/Testing",
- "//llvm/lib/Support",
- "//llvm/lib/Testing/Annotations",
- "//llvm/lib/Testing/Support",
- ]
- include_dirs = [ "../include" ]
- sources = [
- "BracketTest.cpp",
- "CXXTest.cpp",
- "DirectiveTreeTest.cpp",
- "DisambiguateTest.cpp",
- "ForestTest.cpp",
- "GLRTest.cpp",
- "GrammarTest.cpp",
- "LRTableTest.cpp",
- "TokenTest.cpp",
- ]
-}
diff --git a/llvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn b/llvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn
index 5d3497e7e00441..2363dad4bd34ea 100644
--- a/llvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn
@@ -1,6 +1,5 @@
import("//bolt/test/bolt_lit_site_cfg_files.gni")
import("//clang-tools-extra/clangd/test/clangd_lit_site_cfg_files.gni")
-import("//clang-tools-extra/pseudo/test/clang_pseudo_lit_site_cfg_files.gni")
import("//clang-tools-extra/test/clang_tools_extra_lit_site_cfg_files.gni")
import("//clang/test/clang_lit_site_cfg_files.gni")
import("//lld/test/lld_lit_site_cfg_files.gni")
@@ -24,8 +23,6 @@ write_cmake_config("llvm-lit") {
deps += [
"//clang-tools-extra/clangd/test:lit_site_cfg",
"//clang-tools-extra/clangd/test:lit_unit_site_cfg",
- "//clang-tools-extra/pseudo/test:lit_site_cfg",
- "//clang-tools-extra/pseudo/test:lit_unit_site_cfg",
"//clang-tools-extra/test:lit_site_cfg",
"//clang-tools-extra/test:lit_unit_site_cfg",
"//clang/test:lit_site_cfg",
@@ -65,14 +62,6 @@ write_cmake_config("llvm-lit") {
"//clang-tools-extra/clangd/unittests/lit.cfg.py",
clangd_lit_unit_site_cfg_file,
],
- [
- "//clang-tools-extra/pseudo/test/lit.cfg.py",
- clang_pseudo_lit_site_cfg_file,
- ],
- [
- "//clang-tools-extra/pseudo/test/Unit/lit.cfg.py",
- clang_pseudo_lit_unit_site_cfg_file,
- ],
[
"//clang/test/lit.cfg.py",
clang_lit_site_cfg_file,
More information about the llvm-commits
mailing list