From: Hans Wennborg Date: Mon, 9 Apr 2018 12:21:12 +0000 (+0000) Subject: Try to fix libclang reproducer tests after r329465 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=66f72252773ee131bc19bbe3f70fd5494ea4a9dc;p=platform%2Fupstream%2Fllvm.git Try to fix libclang reproducer tests after r329465 They were failing on Windows because the output YAML didn't parse: YAML:1:664: error: Unrecognized escape code! {"toolchain":"D:\\buildslave\\clang-x64-ninja-win7\\stage1", "libclang.operation":"complete", "libclang.opts":1, "args":["clang", "-fno-spell-checking", "D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\test\Index\create-libclang-completion-reproducer.c", "-Xclang", "-detailed-preprocessing-record", "-fallow-editor-placeholders"], "invocation-args":["-code-completion-at=D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\test\Index\create-libclang-completion-reproducer.c:10:1"], "unsaved_file_hashes":[{"name":"D:\\buildslave\\clang-x64-ninja-win7\\llvm\\tools\\clang\\test\\Index\\create-libclang-completion-reproducer.c", "md5":"aee23773de90e665992b48209351d70e"}]} This adds some more escaping to try to make it work. llvm-svn: 329558 --- diff --git a/clang/tools/libclang/CIndexer.cpp b/clang/tools/libclang/CIndexer.cpp index d902470..30054ea 100644 --- a/clang/tools/libclang/CIndexer.cpp +++ b/clang/tools/libclang/CIndexer.cpp @@ -127,14 +127,14 @@ LibclangInvocationReporter::LibclangInvocationReporter( for (const auto &I : llvm::enumerate(Args)) { if (I.index()) OS << ','; - OS << '"' << I.value() << '"'; + OS << '"' << llvm::yaml::escape(I.value()) << '"'; } if (!InvocationArgs.empty()) { OS << R"(],"invocation-args":[)"; for (const auto &I : llvm::enumerate(InvocationArgs)) { if (I.index()) OS << ','; - OS << '"' << I.value() << '"'; + OS << '"' << llvm::yaml::escape(I.value()) << '"'; } } if (!UnsavedFiles.empty()) {