[Support] Add optional argument to SaturatingAdd() and SaturatingMultiply() to indica...
[oota-llvm.git] / include / llvm / Support / circular_raw_ostream.h
index 2b3c329b5861763d1d2b707231b117c37a481e04..b46fd7f730c914b72c5c83d0817cfbab3fbd7b96 100644 (file)
@@ -17,8 +17,7 @@
 
 #include "llvm/Support/raw_ostream.h"
 
-namespace llvm 
-{
+namespace llvm {
   /// circular_raw_ostream - A raw_ostream which *can* save its data
   /// to a circular buffer, or can pass it through directly to an
   /// underlying stream if specified with a buffer of zero.
@@ -71,7 +70,7 @@ namespace llvm
 
     /// flushBuffer - Dump the contents of the buffer to Stream.
     ///
-    void flushBuffer(void) {
+    void flushBuffer() {
       if (Filled)
         // Write the older portion of the buffer.
         TheStream->write(Cur, BufferArray + BufferSize - Cur);
@@ -81,12 +80,12 @@ namespace llvm
       Filled = false;
     }
 
-    virtual void write_impl(const char *Ptr, size_t Size);
+    void write_impl(const char *Ptr, size_t Size) override;
 
     /// current_pos - Return the current position within the stream,
     /// not counting the bytes currently in the buffer.
     ///
-    virtual uint64_t current_pos() const { 
+    uint64_t current_pos() const override {
       // This has the same effect as calling TheStream.current_pos(),
       // but that interface is private.
       return TheStream->tell() - TheStream->GetNumBytesInBuffer();
@@ -107,30 +106,17 @@ namespace llvm
     /// management of it, etc.
     ///
     circular_raw_ostream(raw_ostream &Stream, const char *Header,
-                         size_t BuffSize = 0, bool Owns = REFERENCE_ONLY) 
-        : raw_ostream(/*unbuffered*/true),
-            TheStream(0),
-            OwnsStream(Owns),
-            BufferSize(BuffSize),
-            BufferArray(0),
-            Filled(false),
-            Banner(Header) {
+                         size_t BuffSize = 0, bool Owns = REFERENCE_ONLY)
+        : raw_ostream(/*unbuffered*/ true), TheStream(nullptr),
+          OwnsStream(Owns), BufferSize(BuffSize), BufferArray(nullptr),
+          Filled(false), Banner(Header) {
       if (BufferSize != 0)
         BufferArray = new char[BufferSize];
       Cur = BufferArray;
       setStream(Stream, Owns);
     }
-    explicit circular_raw_ostream()
-        : raw_ostream(/*unbuffered*/true),
-            TheStream(0),
-            OwnsStream(REFERENCE_ONLY),
-            BufferArray(0),
-            Filled(false),
-            Banner("") {
-      Cur = BufferArray;
-    }
 
-    ~circular_raw_ostream() {
+    ~circular_raw_ostream() override {
       flush();
       flushBufferWithBanner();
       releaseStream();
@@ -151,7 +137,7 @@ namespace llvm
     /// flushBufferWithBanner - Force output of the buffer along with
     /// a small header.
     ///
-    void flushBufferWithBanner(void);
+    void flushBufferWithBanner();
 
   private:
     /// releaseStream - Delete the held stream if needed. Otherwise,
@@ -167,5 +153,4 @@ namespace llvm
   };
 } // end llvm namespace
 
-
 #endif