mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-25 11:00:12 +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.
29 lines
727 B
Markdown
29 lines
727 B
Markdown
# C++ migration tooling
|
|
|
|
<!--
|
|
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
|
|
-->
|
|
|
|
<!-- toc -->
|
|
|
|
## Table of contents
|
|
|
|
- [Overview](#overview)
|
|
- [Structure](#structure)
|
|
|
|
<!-- tocstop -->
|
|
|
|
## Overview
|
|
|
|
`migrate_cpp` assists in migration of C++ code to Carbon. It's currently being
|
|
assembled; more documentation will be added later.
|
|
|
|
## Structure
|
|
|
|
The `migrate_cpp` tool uses a `clang::RecursiveASTVisitor` to traverse Clang's
|
|
AST and, to each node, associate replacements. Each node's replacement is a
|
|
sequence of text, or a reference to some other node that should be used to
|
|
replace it.
|