diff options
author | Alexander Kornienko <alexfh@google.com> | 2017-05-04 15:34:06 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2017-05-04 15:34:06 +0000 |
commit | bde6fa9ca7af14d1423570f3947456ef2d7f36c8 (patch) | |
tree | f57f8f359289e44202e4bc79c69ae377cf6863f0 | |
parent | 79053ff7953d848bf479fdc805f9e671264fbd82 (diff) | |
download | bcm5719-llvm-bde6fa9ca7af14d1423570f3947456ef2d7f36c8.tar.gz bcm5719-llvm-bde6fa9ca7af14d1423570f3947456ef2d7f36c8.zip |
[Tooling] add a createReplacement overload for StringRef
llvm-svn: 302159
-rw-r--r-- | clang/include/clang/Tooling/FixIt.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/include/clang/Tooling/FixIt.h b/clang/include/clang/Tooling/FixIt.h index e2259d4357b..c1e50884928 100644 --- a/clang/include/clang/Tooling/FixIt.h +++ b/clang/include/clang/Tooling/FixIt.h @@ -65,6 +65,13 @@ FixItHint createReplacement(const D &Destination, const S &Source, getText(Source, Context)); } +// \brief Returns a FixItHint to replace \p Destination by \p Source. +template <typename D> +FixItHint createReplacement(const D &Destination, StringRef Source) { + return FixItHint::CreateReplacement(internal::getSourceRange(Destination), + Source); +} + } // end namespace fixit } // end namespace tooling } // end namespace clang |