summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/BinaryFormat/MsgPackDocumentYAML.cpp2
-rw-r--r--llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp6
2 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/BinaryFormat/MsgPackDocumentYAML.cpp b/llvm/lib/BinaryFormat/MsgPackDocumentYAML.cpp
index ae67d7be132..1d9c81ef8eb 100644
--- a/llvm/lib/BinaryFormat/MsgPackDocumentYAML.cpp
+++ b/llvm/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/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
index 834f651c42d..245b5e74ac6 100644
--- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud