summaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-08-13 23:16:59 +0000
committerDan Gohman <gohman@apple.com>2009-08-13 23:16:59 +0000
commit6c304f2314e5fb00488ac6bdfdac180c0ffd3d09 (patch)
treed6f6c33489a410db659ede1f8b0b230eb691b5d5 /lib/VMCore
parent009fc9e5d9058a1d3b64bf5cacb29d4f0c952ca5 (diff)
downloadllvm-6c304f2314e5fb00488ac6bdfdac180c0ffd3d09.tar.gz
llvm-6c304f2314e5fb00488ac6bdfdac180c0ffd3d09.tar.bz2
llvm-6c304f2314e5fb00488ac6bdfdac180c0ffd3d09.tar.xz
Make formatted_raw_ostream restore the buffer settings of the
underlying stream when it is finished, so that clients don't have to do this manually. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78952 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/AsmWriter.cpp10
1 files changed, 0 insertions, 10 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index 35aae41e34..68a45221ac 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -2005,14 +2005,9 @@ void Module::print(std::ostream &o, AssemblyAnnotationWriter *AAW) const {
}
void Module::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW) const {
SlotTracker SlotTable(this);
- size_t OldBufferSize = ROS.GetBufferSize();
formatted_raw_ostream OS(ROS);
AssemblyWriter W(OS, SlotTable, this, AAW);
W.write(this);
- // formatted_raw_ostream forces the underlying raw_ostream to be
- // unbuffered. Reset it to its original buffer size.
- if (OldBufferSize != 0)
- ROS.SetBufferSize(OldBufferSize);
}
void Type::print(std::ostream &o) const {
@@ -2033,7 +2028,6 @@ void Value::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW) const {
ROS << "printing a <null> value\n";
return;
}
- size_t OldBufferSize = ROS.GetBufferSize();
formatted_raw_ostream OS(ROS);
if (const Instruction *I = dyn_cast<Instruction>(this)) {
const Function *F = I->getParent() ? I->getParent()->getParent() : 0;
@@ -2089,10 +2083,6 @@ void Value::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW) const {
} else {
llvm_unreachable("Unknown value to print out!");
}
- // formatted_raw_ostream forces the underlying raw_ostream to be
- // unbuffered. Reset it to its original buffer size.
- if (OldBufferSize != 0)
- ROS.SetBufferSize(OldBufferSize);
}
void Value::print(std::ostream &O, AssemblyAnnotationWriter *AAW) const {