From 496bd0b8a5fe82d3f4f5740333dd6ee37f1d6838 Mon Sep 17 00:00:00 2001
From: Diego Novillo <dnovillo@google.com>
Date: Thu, 30 Oct 2014 18:48:41 +0000
Subject: [PATCH] Fix Twine corruption problem with diagnostics.

This fixes the autobuilders I broke with a recent patch. Thanks echristo
and dblaikie for beating me with a clue stick.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220918 91177308-0d34-0410-b5e6-96231b3b80d8
---
 lib/Transforms/Scalar/SampleProfile.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/Transforms/Scalar/SampleProfile.cpp b/lib/Transforms/Scalar/SampleProfile.cpp
index 8d5480c7cb5..89f0c27070b 100644
--- a/lib/Transforms/Scalar/SampleProfile.cpp
+++ b/lib/Transforms/Scalar/SampleProfile.cpp
@@ -740,8 +740,7 @@ bool SampleProfileLoader::doInitialization(Module &M) {
   if (std::error_code EC =
           SampleProfileReader::create(Filename, Reader, M.getContext())) {
     std::string Msg = "Could not open profile: " + EC.message();
-    DiagnosticInfoSampleProfile Diag(Filename.data(), Msg);
-    M.getContext().diagnose(Diag);
+    M.getContext().diagnose(DiagnosticInfoSampleProfile(Filename.data(), Msg));
     return false;
   }
   ProfileIsValid = (Reader->read() == sampleprof_error::success);