r193353 - Revert "Tooling/ReplacementsYaml.h: Prune Tooling's llvm::yaml::ScalarTraits<std::string> corresponding to LLVM r193344."
Argyrios Kyrtzidis
akyrtzi at gmail.com
Thu Oct 24 08:49:11 PDT 2013
Author: akirtzidis
Date: Thu Oct 24 10:49:10 2013
New Revision: 193353
URL: http://llvm.org/viewvc/llvm-project?rev=193353&view=rev
Log:
Revert "Tooling/ReplacementsYaml.h: Prune Tooling's llvm::yaml::ScalarTraits<std::string> corresponding to LLVM r193344."
This reverts commit r193350, because it addressed an llvm API change that has been reverted.
Modified:
cfe/trunk/include/clang/Tooling/ReplacementsYaml.h
Modified: cfe/trunk/include/clang/Tooling/ReplacementsYaml.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Tooling/ReplacementsYaml.h?rev=193353&r1=193352&r2=193353&view=diff
==============================================================================
--- cfe/trunk/include/clang/Tooling/ReplacementsYaml.h (original)
+++ cfe/trunk/include/clang/Tooling/ReplacementsYaml.h Thu Oct 24 10:49:10 2013
@@ -26,6 +26,18 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(clang::tool
namespace llvm {
namespace yaml {
+/// \brief ScalarTraits to read/write std::string objects.
+template <> struct ScalarTraits<std::string> {
+ static void output(const std::string &Val, void *, llvm::raw_ostream &Out) {
+ Out << Val;
+ }
+
+ static StringRef input(StringRef Scalar, void *, std::string &Val) {
+ Val = Scalar;
+ return StringRef();
+ }
+};
+
/// \brief Specialized MappingTraits to describe how a Replacement is
/// (de)serialized.
template <> struct MappingTraits<clang::tooling::Replacement> {
More information about the cfe-commits
mailing list