]> granicus.if.org Git - llvm/commitdiff
[MsgPack][AMDGPU] Fix unflushed raw_string_ostream bugs on windows expensive checks bot
authorTim Renouf <tpr.llvm@botech.co.uk>
Mon, 18 Mar 2019 19:00:46 +0000 (19:00 +0000)
committerTim Renouf <tpr.llvm@botech.co.uk>
Mon, 18 Mar 2019 19:00:46 +0000 (19:00 +0000)
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
lib/Target/AMDGPU/SIMachineFunctionInfo.cpp

index ae67d7be1325a30df1557fee0674b7ba38aad8fb..1d9c81ef8ebc66ac77b1563e0f532a7447b0c10d 100644 (file)
@@ -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
index 834f651c42d8d9f1295178c6ee828c71b773baf1..245b5e74ac64b3943f0390baac3d09c436de4243 100644 (file)
@@ -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;
 }