[cfe-dev] RFC: Adding a rename refactoring tool to clang
Amin Shali
amshali at google.com
Fri Jul 25 13:01:48 PDT 2014
Folks,
At Google we are working on a tool and set of APIs for refactoring C++
programs based on LibTooling. Particularly, we have targeted rename
refactoring for C++ as our first step.
In our first iteration we want to offer two things:
1- A command line tool similar to clang-format which will semantically
rename a symbol (specified by a position in a file) in a set of input files.
2- An API for doing the above task which can effectively be used to provide
this functionality for any editor (Emacs, Vim, CodeMirror, etc.).
== Renaming capabilities
In the first iteration, we are offering the following features for the
rename refactoring:
=== Supported C++ constructs:
- Global and local variables (including function arguments)
- Functions
- C and CXX record types (structs/unions/classes)
- For classes this includes renaming the constructor and
destructor
- User defined types
- Enumerations (names and constants)
- Record member variables and methods
- Namespace specifiers
- Template parameters
- Lambda captures
- Overloaded operators
=== Unsupported C++ constructs:
- Macros
- Symbols in comments
== Command line program
=== Current support:
- Input from stdin, output to stdout
- Input and output from/to disk
- Option to specify include path
- Option to predefine macros
=== Possible improvements:
- Multiple files from stdin
- Making backups of renamed files
We think this tool should reside in clang-tools-extra.
Please let us know what you think. Any comment and feedback is appreciated.
Thank you.
*Λ*MIN シ | amshali@ <amshali at google.com> | Google Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140725/ddeb2719/attachment.html>
More information about the cfe-dev
mailing list