[PATCH] D64123: Add clang-llvm-rename tool.

Rui Ueyama via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 3 17:36:02 PDT 2019


ruiu added a comment.

In D64123#1568096 <https://reviews.llvm.org/D64123#1568096>, @Eugene.Zelenko wrote:

> There is clang-rename <https://github.com/llvm/llvm-project/tree/master/clang/tools/clang-rename> already. May be new functionality should be added there?


clang-rename seems to focus on renaming a variable in a selected region with the interactive use in mind. I.e. a user selects a variable on an IDE and rename its definition and all references.

I actually tried to create this tool based on clang-rename but failed because clang-rename was too slow for my purpose. It takes a non-negligible amount of time even for renaming a single variable, and I wanted to rename thousands or tens of thousands variables.

There are a few other significant differences between this tool and clang-rename as shown below:

- this tool renames a variable only when it can see the definition of the variable, while clang-rename renames a specified variable unconditionally
- clang-rename is an interactive tool, and you need to specify a new name by hand. On the other hand, this tool automatically generates a new name for each variable
- the core part of my tool is to find variables to rename, while clang-rename doesn't do anything for that

Overall, this tool is I think significantly different from clang-rename.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64123/new/

https://reviews.llvm.org/D64123





More information about the cfe-commits mailing list