[PATCH] D66652: [libTooling] Transformer: refine `SourceLocation` specified as anchor of changes.

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 23 07:02:07 PDT 2019


ymandel created this revision.
ymandel added a reviewer: gribozavr.
Herald added a project: clang.

Every change triggered by a rewrite rule is anchored at a particular location in
the source code.  This patch refines how that location is chosen when the rule
matches within a macro and defines it as an explicit function so it can be
shared by other Transformer implementations (e.g. in clang tidy).

This patch was inspired by a bug found by a clang tidy, wherein two changes were
anchored at the same location (the expansion loc of the macro) resulting in the
discarding of the second change.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66652

Files:
  clang/include/clang/Tooling/Refactoring/Transformer.h
  clang/lib/Tooling/Refactoring/Transformer.cpp
  clang/unittests/Tooling/TransformerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66652.216834.patch
Type: text/x-patch
Size: 4697 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190823/ec377945/attachment.bin>


More information about the cfe-commits mailing list