Files
carbon-lang/migrate_cpp/cpp_refactoring/BUILD
T
Jon Ross-Perkins a3b1c433be Remove legacy repo_name settings (#3772)
I'd kept these in to separate the bazel module update from the BUILD
file changes, then forgot about it. I think all of these can be cleanly
removed now. I think it's something we should clean up for consistency
with the bazel central repository names; I think it's best to reduce
that divergence.

llvm_zlib and llvm_zstd remain because of how llvm depends on the
particular names.
2024-03-13 22:58:56 +00:00

121 lines
2.6 KiB
Python

# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
package(default_visibility = ["//visibility:public"])
cc_binary(
name = "cpp_refactoring",
srcs = ["main.cpp"],
deps = [
":fn_inserter",
":for_range",
":matcher",
":var_decl",
"@llvm-project//clang:tooling",
],
)
cc_library(
name = "matcher",
srcs = ["matcher.cpp"],
hdrs = [
"matcher.h",
"matcher_manager.h",
],
deps = [
"@llvm-project//clang:ast_matchers",
"@llvm-project//clang:basic",
"@llvm-project//clang:lex",
"@llvm-project//clang:tooling_core",
],
)
cc_library(
name = "matcher_test_base",
testonly = 1,
hdrs = ["matcher_test_base.h"],
deps = [
":matcher",
"@googletest//:gtest",
"@llvm-project//clang:ast_matchers",
"@llvm-project//clang:tooling",
"@llvm-project//clang:tooling_core",
],
)
# Individual matchers
cc_library(
name = "fn_inserter",
srcs = ["fn_inserter.cpp"],
hdrs = ["fn_inserter.h"],
deps = [
":matcher",
"@llvm-project//clang:ast_matchers",
],
)
cc_test(
name = "fn_inserter_test",
size = "small",
srcs = ["fn_inserter_test.cpp"],
deps = [
":fn_inserter",
":matcher_test_base",
"//testing/base:gtest_main",
"@googletest//:gtest",
"@llvm-project//clang:tooling",
],
)
cc_library(
name = "for_range",
srcs = ["for_range.cpp"],
hdrs = ["for_range.h"],
deps = [
":matcher",
"@llvm-project//clang:ast_matchers",
],
)
cc_test(
name = "for_range_test",
size = "small",
srcs = ["for_range_test.cpp"],
deps = [
":for_range",
":matcher_test_base",
"//testing/base:gtest_main",
"@googletest//:gtest",
"@llvm-project//clang:tooling",
],
)
cc_library(
name = "var_decl",
srcs = ["var_decl.cpp"],
hdrs = ["var_decl.h"],
deps = [
":matcher",
"@llvm-project//clang:ast_matchers",
"@llvm-project//clang:type_nodes_gen",
"@llvm-project//llvm:Support",
],
)
cc_test(
name = "var_decl_test",
size = "small",
srcs = ["var_decl_test.cpp"],
deps = [
":matcher_test_base",
":var_decl",
"//testing/base:gtest_main",
"@googletest//:gtest",
"@llvm-project//clang:tooling",
],
)