]> granicus.if.org Git - clang/commitdiff
Switch another write_escaped to yaml::escape
authorBen Langmuir <blangmuir@apple.com>
Fri, 16 May 2014 01:38:59 +0000 (01:38 +0000)
committerBen Langmuir <blangmuir@apple.com>
Fri, 16 May 2014 01:38:59 +0000 (01:38 +0000)
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
unittests/libclang/LibclangTest.cpp

index c9d3c553273bd1ebb850ebf80b7f72e562a82042..e5caa5447ba1ce21fe7d006226d67f52a969007b 100644 (file)
@@ -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";
index addffe5036f9d3c9356824e0769d20796cad146e..50d4c489f23ceaf4d964fd1e3984919331713c18 100644 (file)
@@ -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);