gollvm: sync with LLVM trunk

Update to handle changes the optimization record file machinery.

Change-Id: Ia134a983c4feda097a0f8f0c87af5d8b0479d994
Reviewed-on: https://go-review.googlesource.com/c/gollvm/+/167598
Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/driver/CompileGo.cpp b/driver/CompileGo.cpp
index 12b5333..e217fcb 100644
--- a/driver/CompileGo.cpp
+++ b/driver/CompileGo.cpp
@@ -42,6 +42,7 @@
 #include "llvm/IR/IRPrintingPasses.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/LegacyPassManager.h"
+#include "llvm/IR/RemarkStreamer.h"
 #include "llvm/IR/Verifier.h"
 #include "llvm/MC/SubtargetFeature.h"
 #include "llvm/Option/Arg.h"
@@ -437,8 +438,8 @@
                << fname << "' to emit optimization remarks\n";
         return false;
       }
-      context_.setDiagnosticsOutputFile(
-          llvm::make_unique<yaml::Output>(optRecordFile_->os()));
+      context_.setRemarkStreamer(llvm::make_unique<llvm::RemarkStreamer>(
+          fname, optRecordFile_->os()));
       if (! sampleProfileFile_.empty())
         context_.setDiagnosticsHotnessRequested(true);
       optRecordFile_->keep();