Index: lib/BinaryFormat/MsgPackDocumentYAML.cpp =================================================================== --- lib/BinaryFormat/MsgPackDocumentYAML.cpp +++ lib/BinaryFormat/MsgPackDocumentYAML.cpp @@ -61,7 +61,7 @@ llvm_unreachable("not scalar"); break; } - return S; + return OS.str(); } /// Convert the StringRef and use it to set this DocNode (assuming scalar). If Index: lib/Target/AMDGPU/SIMachineFunctionInfo.cpp =================================================================== --- lib/Target/AMDGPU/SIMachineFunctionInfo.cpp +++ lib/Target/AMDGPU/SIMachineFunctionInfo.cpp @@ -325,6 +325,7 @@ yaml::StringValue Dest; raw_string_ostream OS(Dest.Value); OS << printReg(Reg, &TRI); + OS.flush(); return Dest; }