diff options
author | Ben Langmuir <blangmuir@apple.com> | 2014-04-17 03:31:02 +0000 |
---|---|---|
committer | Ben Langmuir <blangmuir@apple.com> | 2014-04-17 03:31:02 +0000 |
commit | a56071c5fbe05b6fd8da3388fc60a959a6fc6464 (patch) | |
tree | 13c636beea094993b5a1a3e82c4c4e5aa960ba21 /clang/tools/libclang/BuildSystem.cpp | |
parent | 4b55a9c841c9118c92e059716c0f2b7d152c6be9 (diff) | |
download | bcm5719-llvm-a56071c5fbe05b6fd8da3388fc60a959a6fc6464.tar.gz bcm5719-llvm-a56071c5fbe05b6fd8da3388fc60a959a6fc6464.zip |
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
Diffstat (limited to 'clang/tools/libclang/BuildSystem.cpp')
-rw-r--r-- | clang/tools/libclang/BuildSystem.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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()) { |