[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. ymandel marked an inline comment as done. Closed by commit rL366473: [LibTooling] Relax Transformer to allow rewriting macro expansions (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a

[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-18 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64518/new/ https://reviews.llvm.org/D64518

[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 210576. ymandel added a comment. remove unneeded include Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64518/new/ https://reviews.llvm.org/D64518 Files: clang/lib/Tooling/Refactoring/Transformer.cpp

[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 3 inline comments as done. ymandel added inline comments. Comment at: clang/lib/Tooling/Refactoring/Transformer.cpp:76 +static llvm::Optional +makeValidRange(CharSourceRange Range, const MatchResult ) { + const SourceManager = *Result.SourceManager;

[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 210575. ymandel added a comment. Moved `makeValidRange` to its own revision and rebased onto that. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64518/new/ https://reviews.llvm.org/D64518 Files:

[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In D64518#1589857 , @ymandel wrote: > In D64518#1589768 , @ilya-biryukov > wrote: > > > In D64518#1588092 , @ymandel wrote: > > > > > This

[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D64518#1589768 , @ilya-biryukov wrote: > In D64518#1588092 , @ymandel wrote: > > > This seems like a good candidate for configuration -- the user could then > > choose which mode to

[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In D64518#1588092 , @ymandel wrote: > This seems like a good candidate for configuration -- the user could then > choose which mode to run in. But, I'm also open to just reporting these > conditions as errors. It's

[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 210148. ymandel added a comment. tweaks in response to comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64518/new/ https://reviews.llvm.org/D64518 Files: clang/lib/Tooling/Refactoring/Transformer.cpp

[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added a comment. In D64518#1585917 , @ilya-biryukov wrote: > This clearly increases the utility of the library, but also seems to add > corner cases that the library won't handle (see the comment about

[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-15 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. This clearly increases the utility of the library, but also seems to add corner cases that the library won't handle (see the comment about unittests for an example). WDYT about those? Are they important, should we support producing warnings in those cases to let

[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: ilya-biryukov. Herald added a project: clang. Currently, Transformer rejects any changes to source locations inside macro expansions. This change relaxes that constraint to allow rewrites when the entirety of the expansion is replaced,