r302159 - [Tooling] add a createReplacement overload for StringRef
Alexander Kornienko via cfe-commits
cfe-commits at lists.llvm.org
Thu May 4 08:34:06 PDT 2017
Author: alexfh
Date: Thu May 4 10:34:06 2017
New Revision: 302159
URL: http://llvm.org/viewvc/llvm-project?rev=302159&view=rev
Log:
[Tooling] add a createReplacement overload for StringRef
Modified:
cfe/trunk/include/clang/Tooling/FixIt.h
Modified: cfe/trunk/include/clang/Tooling/FixIt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Tooling/FixIt.h?rev=302159&r1=302158&r2=302159&view=diff
==============================================================================
--- cfe/trunk/include/clang/Tooling/FixIt.h (original)
+++ cfe/trunk/include/clang/Tooling/FixIt.h Thu May 4 10:34:06 2017
@@ -65,6 +65,13 @@ FixItHint createReplacement(const D &Des
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
More information about the cfe-commits
mailing list