This is an archive of the discontinued LLVM Phabricator instance.

[LibTooling] Extend `RewriteRule` with support for adding includes.
ClosedPublic

Authored by ymandel on Jun 27 2019, 1:14 PM.

Details

Summary

This revision allows users to specify the insertion of an included directive (at
the top of the file being rewritten) as part of a rewrite rule. These
directives are bundled with RewriteRule cases, so that different cases can
potentially result in different include actions.

Event Timeline

ymandel created this revision.Jun 27 2019, 1:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2019, 1:14 PM
gribozavr accepted this revision.Jun 28 2019, 6:47 AM
gribozavr added inline comments.
clang/include/clang/Tooling/Refactoring/Transformer.h
123

s/that//

152

The example looks incomplete to me because it does not call addInclude...

This revision is now accepted and ready to land.Jun 28 2019, 6:47 AM
ymandel updated this revision to Diff 207082.Jun 28 2019, 9:52 AM

Responded to comments.

ymandel updated this revision to Diff 207083.Jun 28 2019, 9:53 AM
ymandel marked 2 inline comments as done.

comments tweak.

gribozavr accepted this revision.Jul 1 2019, 5:55 AM

LGTM, thanks!

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 2 2019, 6:13 AM