mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
The approach uses a RecursiveASTVisitor rather than matchers. Matchers and callbacks do not compose neatly and introduce significant runtime overhead over RecursiveASTVisitor when an action needs to be performed on most nodes.
53 lines
1.3 KiB
Python
53 lines
1.3 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
|
|
|
|
py_binary(
|
|
name = "migrate_cpp",
|
|
srcs = ["migrate_cpp.py"],
|
|
data = [
|
|
":clang_tidy.yaml",
|
|
"//migrate_cpp/cpp_refactoring",
|
|
],
|
|
python_version = "PY3",
|
|
)
|
|
|
|
cc_library(
|
|
name = "output_segment",
|
|
hdrs = ["output_segment.h"],
|
|
deps = [
|
|
"//common:check",
|
|
"@llvm-project//clang:ast",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "rewriter",
|
|
srcs = ["rewriter.cpp"],
|
|
hdrs = ["rewriter.h"],
|
|
deps = [
|
|
":output_segment",
|
|
"//common:check",
|
|
"@llvm-project//clang:ast",
|
|
"@llvm-project//clang:basic",
|
|
"@llvm-project//clang:frontend",
|
|
"@llvm-project//clang:lex",
|
|
"@llvm-project//clang:tooling",
|
|
"@llvm-project//clang:tooling_core",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "rewriter_test",
|
|
srcs = ["rewriter_test.cpp"],
|
|
deps = [
|
|
":rewriter",
|
|
"//common:gtest_main",
|
|
"@com_google_googletest//:gtest",
|
|
"@llvm-project//clang:ast",
|
|
"@llvm-project//clang:frontend",
|
|
"@llvm-project//clang:tooling",
|
|
],
|
|
)
|