summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/raw_ostream.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-08-13 15:58:55 +0000
committerDan Gohman <gohman@apple.com>2009-08-13 15:58:55 +0000
commit54401d41742b2d33c61f3fc67884cb8f3e1eb41d (patch)
treee8d6f52dc7570cbb6ddb3e858d65bb3bf53f40a4 /llvm/lib/Support/raw_ostream.cpp
parenta9c2aad939d102b86f83588b3238b071ca266a9c (diff)
downloadbcm5719-llvm-54401d41742b2d33c61f3fc67884cb8f3e1eb41d.tar.gz
bcm5719-llvm-54401d41742b2d33c61f3fc67884cb8f3e1eb41d.zip
Move SetBufferSize and SetUnbuffered out of line.
llvm-svn: 78909
Diffstat (limited to 'llvm/lib/Support/raw_ostream.cpp')
-rw-r--r--llvm/lib/Support/raw_ostream.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index 11a11bd930a..2a2458d61a3 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/lib/Support/raw_ostream.cpp
@@ -63,6 +63,26 @@ raw_ostream::~raw_ostream() {
// An out of line virtual method to provide a home for the class vtable.
void raw_ostream::handle() {}
+void raw_ostream::SetBufferSize(size_t Size) {
+ assert(Size >= 64 &&
+ "Buffer size must be somewhat large for invariants to hold");
+ flush();
+
+ delete [] OutBufStart;
+ OutBufStart = new char[Size];
+ OutBufEnd = OutBufStart+Size;
+ OutBufCur = OutBufStart;
+ Unbuffered = false;
+}
+
+void raw_ostream::SetUnbuffered() {
+ flush();
+
+ delete [] OutBufStart;
+ OutBufStart = OutBufEnd = OutBufCur = 0;
+ Unbuffered = true;
+}
+
raw_ostream &raw_ostream::operator<<(unsigned long N) {
// Zero is a special case.
if (N == 0)
OpenPOWER on IntegriCloud