]> granicus.if.org Git - clang/commitdiff
Address review comment on r189557.
authorEli Friedman <eli.friedman@gmail.com>
Tue, 17 Sep 2013 00:51:31 +0000 (00:51 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Tue, 17 Sep 2013 00:51:31 +0000 (00:51 +0000)
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

lib/Rewrite/Frontend/InclusionRewriter.cpp

index 3fba6905e1ef9208b1590cd87922c0c9c13901de..49b23dd1f4a38f5b5a197cd6891886f14cd36665 100644 (file)
@@ -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