From e38a937ce0e856e9a358166d05d08efb4d381614 Mon Sep 17 00:00:00 2001 From: Tim Renouf Date: Mon, 18 Mar 2019 19:00:46 +0000 Subject: [PATCH] [MsgPack][AMDGPU] Fix unflushed raw_string_ostream bugs on windows expensive checks bot This fixes a couple of unflushed raw_string_ostream bugs in recent commits that only show up on a bot building on windows with expensive checks. Differential Revision: https://reviews.llvm.org/D59396 Change-Id: I9c6208325503b3ee0786b4b688e13fc24a15babf git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356394 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/BinaryFormat/MsgPackDocumentYAML.cpp | 2 +- lib/Target/AMDGPU/SIMachineFunctionInfo.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/BinaryFormat/MsgPackDocumentYAML.cpp b/lib/BinaryFormat/MsgPackDocumentYAML.cpp index ae67d7be132..1d9c81ef8eb 100644 --- a/lib/BinaryFormat/MsgPackDocumentYAML.cpp +++ b/lib/BinaryFormat/MsgPackDocumentYAML.cpp @@ -61,7 +61,7 @@ std::string DocNode::toString() const { llvm_unreachable("not scalar"); break; } - return S; + return OS.str(); } /// Convert the StringRef and use it to set this DocNode (assuming scalar). If diff --git a/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp b/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp index 834f651c42d..245b5e74ac6 100644 --- a/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp +++ b/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp @@ -323,8 +323,10 @@ MCPhysReg SIMachineFunctionInfo::getNextSystemSGPR() const { static yaml::StringValue regToString(unsigned Reg, const TargetRegisterInfo &TRI) { yaml::StringValue Dest; - raw_string_ostream OS(Dest.Value); - OS << printReg(Reg, &TRI); + { + raw_string_ostream OS(Dest.Value); + OS << printReg(Reg, &TRI); + } return Dest; } -- 2.50.1