Integrate 3 months of ObjC rewriter fixes (from the Apple/objective-rewrite branch).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70385 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/clang-cc/PrintPreprocessedOutput.cpp b/tools/clang-cc/PrintPreprocessedOutput.cpp
index a2047fa..c7eb72b 100644
--- a/tools/clang-cc/PrintPreprocessedOutput.cpp
+++ b/tools/clang-cc/PrintPreprocessedOutput.cpp
@@ -422,9 +422,10 @@
   // to -C or -CC.
   PP.SetCommentRetentionState(EnableCommentOutput, EnableMacroCommentOutput);
   
-  // Open the output buffer.
+  // Open the output buffer using "Binary" mode. On Windows, this distinction
+  // is important (to surpress automatic LF->CFLF conversion).
   std::string Err;
-  llvm::raw_fd_ostream OS(OutFile.empty() ? "-" : OutFile.c_str(), false, Err);
+  llvm::raw_fd_ostream OS(OutFile.empty() ? "-" : OutFile.c_str(), true, Err);
   if (!Err.empty()) {
     fprintf(stderr, "%s\n", Err.c_str());
     exit(1);