Switch another write_escaped to yaml::escape
I missed one in r206443.
llvm-svn: 208941
diff --git a/clang/tools/libclang/BuildSystem.cpp b/clang/tools/libclang/BuildSystem.cpp
index c9d3c55..e5caa54 100644
--- a/clang/tools/libclang/BuildSystem.cpp
+++ b/clang/tools/libclang/BuildSystem.cpp
@@ -115,10 +115,10 @@
OS.indent(Indent) << "{\n";
Indent += 2;
OS.indent(Indent) << "'type': 'directory',\n";
- OS.indent(Indent) << "'name': \"";
StringRef DirName = containedPart(ParentPath,
path::parent_path(Entry.VPath));
- OS.write_escaped(DirName) << "\",\n";
+ OS.indent(Indent)
+ << "'name': \"" << llvm::yaml::escape(DirName) << "\",\n";
OS.indent(Indent) << "'contents': [\n";
Entries = printContents(Entries, Indent + 2);
OS.indent(Indent) << "]\n";
diff --git a/clang/unittests/libclang/LibclangTest.cpp b/clang/unittests/libclang/LibclangTest.cpp
index addffe5..50d4c48 100644
--- a/clang/unittests/libclang/LibclangTest.cpp
+++ b/clang/unittests/libclang/LibclangTest.cpp
@@ -91,7 +91,7 @@
" 'roots': [\n"
" {\n"
" 'type': 'directory',\n"
- " 'name': \"/path/virtual\",\n"
+ " 'name': \"/path/\\u266B\",\n"
" 'contents': [\n"
" {\n"
" 'type': 'file',\n"
@@ -103,7 +103,7 @@
" ]\n"
"}\n";
TestVFO T(contents);
- T.map("/path/virtual/☂.h", "/real/☂.h");
+ T.map("/path/♫/☂.h", "/real/☂.h");
}
{
TestVFO T(NULL);