]> granicus.if.org Git - clang/commitdiff
Escape filenames in module map line marker directives, to unbreak Windows build bots.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 1 Jun 2017 20:10:35 +0000 (20:10 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 1 Jun 2017 20:10:35 +0000 (20:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304464 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/FrontendActions.cpp
lib/Frontend/Rewrite/FrontendActions.cpp

index baaf93b167bc2b7dd97850f064b7984ed3d8091d..89ac385ca45d505cf4a0e01db9a19143097a47b0 100644 (file)
@@ -546,8 +546,11 @@ void PrintPreprocessedAction::ExecuteAction() {
   // module itself before switching to the input buffer.
   auto &Input = getCurrentInput();
   if (Input.getKind().getFormat() == InputKind::ModuleMap) {
-    if (Input.isFile())
-      (*OS) << "# 1 \"" << Input.getFile() << "\"\n";
+    if (Input.isFile()) {
+      (*OS) << "# 1 \"";
+      OS->write_escaped(Input.getFile());
+      (*OS) << "\"\n";
+    }
     // FIXME: Include additional information here so that we don't need the
     // original source files to exist on disk.
     getCurrentModule()->print(*OS);
index 8c5eb161b5ab1f4691df6bffb4a04ab9961510b6..b2dfd294113021be8b6401b4b90b2d5542b41f12 100644 (file)
@@ -200,8 +200,11 @@ void RewriteIncludesAction::ExecuteAction() {
   // module itself before switching to the input buffer.
   auto &Input = getCurrentInput();
   if (Input.getKind().getFormat() == InputKind::ModuleMap) {
-    if (Input.isFile())
-      (*OS) << "# 1 \"" << Input.getFile() << "\"\n";
+    if (Input.isFile()) {
+      (*OS) << "# 1 \"";
+      OS->write_escaped(Input.getFile());
+      (*OS) << "\"\n";
+    }
     // FIXME: Include additional information here so that we don't need the
     // original source files to exist on disk.
     getCurrentModule()->print(*OS);