From a56071c5fbe05b6fd8da3388fc60a959a6fc6464 Mon Sep 17 00:00:00 2001 From: Ben Langmuir Date: Thu, 17 Apr 2014 03:31:02 +0000 Subject: When writing YAML in libclang, use yaml::escape instead of write_escaped The YAMLParser has its own escaped string representation, and does not handle octal escape sequences. When writing the virtual file system to a YAML file, use yaml::escape(). llvm-svn: 206443 --- clang/tools/libclang/BuildSystem.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'clang/tools/libclang/BuildSystem.cpp') diff --git a/clang/tools/libclang/BuildSystem.cpp b/clang/tools/libclang/BuildSystem.cpp index 89c6e91d23c..c9d3c553273 100644 --- a/clang/tools/libclang/BuildSystem.cpp +++ b/clang/tools/libclang/BuildSystem.cpp @@ -19,6 +19,7 @@ #include "llvm/Support/Path.h" #include "llvm/Support/TimeValue.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Support/YAMLParser.h" using namespace clang; using namespace llvm::sys; @@ -147,10 +148,9 @@ private: OS.indent(Indent) << "{\n"; Indent += 2; OS.indent(Indent) << "'type': 'file',\n"; - OS.indent(Indent) << "'name': \""; - OS.write_escaped(VName) << "\",\n"; - OS.indent(Indent) << "'external-contents': \""; - OS.write_escaped(Entry.RPath) << "\"\n"; + OS.indent(Indent) << "'name': \"" << llvm::yaml::escape(VName) << "\",\n"; + OS.indent(Indent) << "'external-contents': \"" + << llvm::yaml::escape(Entry.RPath) << "\"\n"; Indent -= 2; OS.indent(Indent) << '}'; if (Entries.empty()) { -- cgit v1.2.3