From 74a4aaa5ce9d33fd24a8881e5bc1a3531887eb6b Mon Sep 17 00:00:00 2001 From: Ben Langmuir Date: Fri, 16 May 2014 01:38:59 +0000 Subject: [PATCH] Switch another write_escaped to yaml::escape I missed one in r206443. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208941 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/libclang/BuildSystem.cpp | 4 ++-- unittests/libclang/LibclangTest.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/libclang/BuildSystem.cpp b/tools/libclang/BuildSystem.cpp index c9d3c55327..e5caa5447b 100644 --- a/tools/libclang/BuildSystem.cpp +++ b/tools/libclang/BuildSystem.cpp @@ -115,10 +115,10 @@ private: 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/unittests/libclang/LibclangTest.cpp b/unittests/libclang/LibclangTest.cpp index addffe5036..50d4c489f2 100644 --- a/unittests/libclang/LibclangTest.cpp +++ b/unittests/libclang/LibclangTest.cpp @@ -91,7 +91,7 @@ TEST(libclang, VirtualFileOverlay) { " 'roots': [\n" " {\n" " 'type': 'directory',\n" - " 'name': \"/path/virtual\",\n" + " 'name': \"/path/\\u266B\",\n" " 'contents': [\n" " {\n" " 'type': 'file',\n" @@ -103,7 +103,7 @@ TEST(libclang, VirtualFileOverlay) { " ]\n" "}\n"; TestVFO T(contents); - T.map("/path/virtual/☂.h", "/real/☂.h"); + T.map("/path/♫/☂.h", "/real/☂.h"); } { TestVFO T(NULL); -- 2.40.0