r329558 - Try to fix libclang reproducer tests after r329465
Hans Wennborg via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 9 05:21:13 PDT 2018
Author: hans
Date: Mon Apr 9 05:21:12 2018
New Revision: 329558
URL: http://llvm.org/viewvc/llvm-project?rev=329558&view=rev
Log:
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.
Modified:
cfe/trunk/tools/libclang/CIndexer.cpp
Modified: cfe/trunk/tools/libclang/CIndexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndexer.cpp?rev=329558&r1=329557&r2=329558&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndexer.cpp (original)
+++ cfe/trunk/tools/libclang/CIndexer.cpp Mon Apr 9 05:21:12 2018
@@ -127,14 +127,14 @@ LibclangInvocationReporter::LibclangInvo
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()) {
More information about the cfe-commits
mailing list