Index: lib/Frontend/FrontendActions.cpp
===================================================================
--- lib/Frontend/FrontendActions.cpp	(revision 139985)
+++ lib/Frontend/FrontendActions.cpp	(working copy)
@@ -183,7 +183,13 @@
   CompilerInstance &CI = getCompilerInstance();
   // Output file needs to be set to 'Binary', to avoid converting Unix style
   // line feeds (<LF>) to Microsoft style line feeds (<CR><LF>).
-  raw_ostream *OS = CI.createDefaultOutputFile(true, getCurrentFile());
+  bool binaryMode = true;
+  #if defined(_WIN32)
+    // When writing out a text file on Windows, CRLF line feeds are the
+    // correct behavior.
+    binaryMode = false;
+  #endif
+  raw_ostream *OS = CI.createDefaultOutputFile(binaryMode, getCurrentFile());
   if (!OS) return;
 
   DoPrintPreprocessedInput(CI.getPreprocessor(), OS,
