From: Eli Friedman Date: Tue, 17 Sep 2013 00:51:31 +0000 (+0000) Subject: Address review comment on r189557. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2b4754bb241bb21b94832916ee07cbf7351b958;p=clang Address review comment on r189557. We need to escape filenames the same way in InclusionRewriter whether UseLineDirective is true or false. Review comment from http://llvm.org/bugs/show_bug.cgi?id=17018#c2 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190834 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Rewrite/Frontend/InclusionRewriter.cpp b/lib/Rewrite/Frontend/InclusionRewriter.cpp index 3fba6905e1..49b23dd1f4 100644 --- a/lib/Rewrite/Frontend/InclusionRewriter.cpp +++ b/lib/Rewrite/Frontend/InclusionRewriter.cpp @@ -110,7 +110,9 @@ void InclusionRewriter::WriteLineInfo(const char *Filename, int Line, if (!ShowLineMarkers) return; if (UseLineDirective) { - OS << "#line" << ' ' << Line << ' ' << '"' << Filename << '"'; + OS << "#line" << ' ' << Line << ' ' << '"'; + OS.write_escaped(Filename); + OS << '"'; } else { // Use GNU linemarkers as described here: // http://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html