From: Alexander Kornienko Date: Thu, 4 May 2017 15:34:06 +0000 (+0000) Subject: [Tooling] add a createReplacement overload for StringRef X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48bb9faec2ce37ee8a26fe131c2e0d66708633c9;p=clang [Tooling] add a createReplacement overload for StringRef git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302159 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Tooling/FixIt.h b/include/clang/Tooling/FixIt.h index e2259d4357..c1e5088492 100644 --- a/include/clang/Tooling/FixIt.h +++ b/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 +FixItHint createReplacement(const D &Destination, StringRef Source) { + return FixItHint::CreateReplacement(internal::getSourceRange(Destination), + Source); +} + } // end namespace fixit } // end namespace tooling } // end namespace clang