aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2014-04-17 03:31:02 +0000
committerBen Langmuir <blangmuir@apple.com>2014-04-17 03:31:02 +0000
commitf288c56a51c852dbae6604455e3ce6386e328095 (patch)
tree4a252afdf7313b221043eb4639d3146106ca6990 /tools
parent8b7a1c51e488639a3fe3854cc03955e9c5b21876 (diff)
downloadclang_35a-f288c56a51c852dbae6604455e3ce6386e328095.tar.gz
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(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206443 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/libclang/BuildSystem.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/libclang/BuildSystem.cpp b/tools/libclang/BuildSystem.cpp
index 89c6e91d23..c9d3c55327 100644
--- a/tools/libclang/BuildSystem.cpp
+++ b/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()) {