get MachineConstantPool off std::ostream, onto raw_ostream. It would be
really nice if someone converted MachineFunction::print to raw_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55268 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp
index bc5d59e..ae97d89 100644
--- a/lib/CodeGen/MachineFunction.cpp
+++ b/lib/CodeGen/MachineFunction.cpp
@@ -248,7 +248,10 @@
JumpTableInfo->print(OS);
// Print Constant Pool
- ConstantPool->print(OS);
+ {
+ raw_os_ostream OSS(OS);
+ ConstantPool->print(OSS);
+ }
const TargetRegisterInfo *TRI = getTarget().getRegisterInfo();
@@ -526,12 +529,7 @@
return Constants.size()-1;
}
-void MachineConstantPoolValue::print(std::ostream &o) const {
- raw_os_ostream OS(o);
- print(OS);
-}
-
-void MachineConstantPool::print(std::ostream &OS) const {
+void MachineConstantPool::print(raw_ostream &OS) const {
for (unsigned i = 0, e = Constants.size(); i != e; ++i) {
OS << " <cp #" << i << "> is";
if (Constants[i].isMachineConstantPoolEntry())
@@ -543,4 +541,4 @@
}
}
-void MachineConstantPool::dump() const { print(*cerr.stream()); }
+void MachineConstantPool::dump() const { print(errs()); errs().flush(); }