[libTooling] Add function to Transformer to create a no-op edit.
authorYitzhak Mandelbaum <yitzhakm@google.com>
Thu, 22 Oct 2020 14:03:59 +0000 (14:03 +0000)
committerYitzhak Mandelbaum <yitzhakm@google.com>
Thu, 22 Oct 2020 21:29:03 +0000 (21:29 +0000)
commit6f8f5cb77efd100e5d4916db871b18c88cf49ed0
treea3b2cab3537e8afcd537f2174242e1a560ddcbac
parent8277a513c74b53e5ad7f482f76b27bc8609c66ae
[libTooling] Add function to Transformer to create a no-op edit.

This functionality is commonly needed in clang tidy checks (based on
transformer) that only print warnings, without suggesting any edits. The no-op
edit allows the user to associate a diagnostic message with a source location.

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