llvm.org GIT mirror llvm / 35979c0
Revert r78924, disabling buffering defeats all the fast paths in raw_ostream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79361 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 10 years ago
2 changed file(s) with 18 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
375375 virtual uint64_t current_pos();
376376
377377 public:
378 raw_os_ostream(std::ostream &O) : raw_ostream(true), OS(O) {}
378 raw_os_ostream(std::ostream &O) : OS(O) {}
379 ~raw_os_ostream();
379380
380381 /// tell - Return the current offset with the stream.
381382 uint64_t tell();
393394 /// counting the bytes currently in the buffer.
394395 virtual uint64_t current_pos() { return OS.size(); }
395396 public:
396 explicit raw_string_ostream(std::string &O) : raw_ostream(true), OS(O) {}
397 explicit raw_string_ostream(std::string &O) : OS(O) {}
398 ~raw_string_ostream();
397399
398400 /// tell - Return the current offset with the stream.
399401 uint64_t tell() { return OS.size() + GetNumBytesInBuffer(); }
419421 /// counting the bytes currently in the buffer.
420422 virtual uint64_t current_pos();
421423 public:
422 explicit raw_svector_ostream(SmallVectorImpl &O)
423 : raw_ostream(true), OS(O) {}
424 explicit raw_svector_ostream(SmallVectorImpl &O) : OS(O) {}
425 ~raw_svector_ostream();
424426
425427 /// tell - Return the current offset with the stream.
426428 uint64_t tell();
455455 // raw_os_ostream
456456 //===----------------------------------------------------------------------===//
457457
458 raw_os_ostream::~raw_os_ostream() {
459 flush();
460 }
461
458462 void raw_os_ostream::write_impl(const char *Ptr, size_t Size) {
459463 OS.write(Ptr, Size);
460464 }
469473 // raw_string_ostream
470474 //===----------------------------------------------------------------------===//
471475
476 raw_string_ostream::~raw_string_ostream() {
477 flush();
478 }
479
472480 void raw_string_ostream::write_impl(const char *Ptr, size_t Size) {
473481 OS.append(Ptr, Size);
474482 }
476484 //===----------------------------------------------------------------------===//
477485 // raw_svector_ostream
478486 //===----------------------------------------------------------------------===//
487
488 raw_svector_ostream::~raw_svector_ostream() {
489 flush();
490 }
479491
480492 void raw_svector_ostream::write_impl(const char *Ptr, size_t Size) {
481493 OS.append(Ptr, Ptr + Size);