[libTooling] Change `addInclude` to use expansion locs.
authorYitzhak Mandelbaum <yitzhakm@google.com>
Tue, 22 Dec 2020 15:02:56 +0000 (15:02 +0000)
committerYitzhak Mandelbaum <yitzhakm@google.com>
Fri, 15 Jan 2021 03:08:56 +0000 (03:08 +0000)
commit1fabe6e51917bcd7a1242294069c682fe6dffa45
tree4bcef7e80a28be232c6a7db7f24c147f29c69c43
parent214387c2c694c92fec713f7ad224f10c1aebc1cf
[libTooling] Change `addInclude` to use expansion locs.

This patch changes the default range used to anchor the include insertion to use
an expansion loc.  This ensures that the location is valid, when the user relies
on the default range.

Driveby: extend a FIXME for a problem that was emphasized by this change; fix some spellings.

Differential Revision: https://reviews.llvm.org/D93703
clang/include/clang/Tooling/Transformer/RewriteRule.h
clang/lib/Tooling/Transformer/RewriteRule.cpp