summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineBlockPlacement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/MachineBlockPlacement.cpp')
-rw-r--r--lib/CodeGen/MachineBlockPlacement.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/CodeGen/MachineBlockPlacement.cpp b/lib/CodeGen/MachineBlockPlacement.cpp
index 891f605e2a..74af1e2d64 100644
--- a/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/lib/CodeGen/MachineBlockPlacement.cpp
@@ -264,19 +264,23 @@ INITIALIZE_PASS_END(MachineBlockPlacement, "block-placement2",
///
/// Only used by debug logging.
static std::string getBlockName(MachineBasicBlock *BB) {
- string_ostream OS;
+ std::string Result;
+ raw_string_ostream OS(Result);
OS << "BB#" << BB->getNumber()
<< " (derived from LLVM BB '" << BB->getName() << "')";
- return OS.str();
+ OS.flush();
+ return Result;
}
/// \brief Helper to print the number of a MBB.
///
/// Only used by debug logging.
static std::string getBlockNum(MachineBasicBlock *BB) {
- string_ostream OS;
+ std::string Result;
+ raw_string_ostream OS(Result);
OS << "BB#" << BB->getNumber();
- return OS.str();
+ OS.flush();
+ return Result;
}
#endif