[llvm-dev] Questions about writing refactoring actions with LLVM

Brenda So via llvm-dev llvm-dev at lists.llvm.org
Sat Dec 30 21:18:29 PST 2017


Hi,

I am currently writing a new refactoring action rule under this bug:

https://bugs.llvm.org/show_bug.cgi?id=35000

The idea is to write a new refactor action for clang-refactor that can
convert a ternary operator into an if statement.

I have used LLVM and Clang before but this is my first time writing a small
feature for the actual code base, so I have a few questions :

1. What does the function SourceChangeRefactoringRule::initiate does? I
can't find documentation that talks about it
2. How can I traverse through the whole file to find the ternary operators?
Where should this traversal take place, or do the APIs already take care of
it. I looked up AST matchers and I am confused as to how it can be
incorporated into the refactoring action.

Thanks!
Brenda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171231/70501f74/attachment.html>


More information about the llvm-dev mailing list