search for: preserve_stream

Displaying 13 results from an estimated 13 matches for "preserve_stream".

2009 Dec 18
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...when we release it. This code > is identical to the code in formatted_raw_ostream. Here's the updated patch. -Dave + /// DELETE_STREAM - Tell the destructor to delete the held stream. + /// + static const bool DELETE_STREAM = true; + + /// PRESERVE_STREAM - Tell the destructor to not delete the held + /// stream. + /// + static const bool PRESERVE_STREAM = false; + + private: + /// TheStream - The real stream we output to. We set it to be + /// unbuffered, since we're already doing our own buffering. + /// + raw_ostream *Th...
2009 Dec 18
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
.../// circular_raw_ostream - A raw_ostream that saves its output in a + /// circular buffer. + /// + class circular_raw_ostream : public raw_ostream { + public: + /// DELETE_STREAM - Tell the destructor to delete the held stream. + /// + static const bool DELETE_STREAM = true; + + /// PRESERVE_STREAM - Tell the destructor to not delete the held + /// stream. + /// + static const bool PRESERVE_STREAM = false; + + private: + /// TheStream - The real stream we output to. We set it to be + /// unbuffered, since we're already doing our own buffering. + /// + raw_ostream *Th...
2009 Dec 16
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...eam, int BufferSize = -1, + bool Delete = false) + : raw_ostream(/*unbuffered*/true), TheStream(0), DeleteStream(false), + BufferArray(BufferSize < 0 ? 8192 : BufferSize), Please make BufferSize an 'unsigned' and default it to 8192. Please use PRESERVE_STREAM instead of 'false'. > Do you want another patch that modifies Debug.h and then one more patch that > shows client use? Sure, you don't need to convert everything over, but once the general approach looks fine you can do the rest without review. -Chris -------------- next part...
2009 Dec 18
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
.../// circular_raw_ostream - A raw_ostream that saves its output in a + /// circular buffer. + /// + class circular_raw_ostream : public raw_ostream { + public: + /// DELETE_STREAM - Tell the destructor to delete the held stream. + /// + static const bool DELETE_STREAM = true; + + /// PRESERVE_STREAM - Tell the destructor to not delete the held + /// stream. + /// + static const bool PRESERVE_STREAM = false; + + private: + /// TheStream - The real stream we output to. We set it to be + /// unbuffered, since we're already doing our own buffering. + /// + raw_ostream *Th...
2009 Dec 16
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...> What does DelayOutput do? Even reading the code, I don't really understand > what it is doing. Originally it told the stream whether to buffer. It's superfluous now so I'll remove it. > Please make BufferSize an 'unsigned' and default it to 8192. Please use > PRESERVE_STREAM instead of 'false'. Ok. > Do you want another patch that modifies Debug.h and then one more patch > that shows client use? > > Sure, you don't need to convert everything over, but once the general > approach looks fine you can do the rest without review. All right....
2009 Dec 17
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Wednesday 16 December 2009 13:35, David Greene wrote: > > Please make BufferSize an 'unsigned' and default it to 8192. Please use > > PRESERVE_STREAM instead of 'false'. Here's an updated version of the circular buffer. Ok to check in? -Dave Index: include/llvm/Support/circular_raw_ostream.h =================================================================== --- include/llvm/Support/circular_raw_ostre...
2009 Dec 19
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...ld it be better to do it on destruction? How about using something like flush_to_underlying_stream() or something like that? > + /// DELETE_STREAM - Tell the destructor to delete the held > stream. > + /// > + static const bool DELETE_STREAM = true; > + > + /// PRESERVE_STREAM - Tell the destructor to not delete the held > + /// stream. > + /// > + static const bool PRESERVE_STREAM = false; I don't find these to be very clear names. How about giving them a name involving 'ownership' like TAKES_OWNERSHIP? "preservation" isn...
2009 Dec 18
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Friday 18 December 2009 13:53, David Greene wrote: > > > + void releaseStream() { > > > + // Delete the stream if needed. Otherwise, transfer the buffer > > > + // settings from this raw_ostream back to the underlying stream. > > > + if (!TheStream) > > > + return; > > > + if (DeleteStream) > > > +
2009 Dec 18
4
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...neath it. > > + /// > > + circular_raw_ostream(raw_ostream &Stream, unsigned BuffSize = 8192, > > + bool Delete = false) > > + : raw_ostream(/*unbuffered*/true), > > + TheStream(0), > > + DeleteStream(PRESERVE_STREAM), > > + BufferSize(BuffSize), > > + BufferArray(0) { > > + if (BufferSize > 0) > > + BufferArray = new char[BufferSize]; > > How about just asserting that BufferSize is not zero? This stream won't > work well and doesn't...
2009 Dec 18
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Dec 17, 2009, at 3:41 PM, David Greene wrote: > On Wednesday 16 December 2009 13:35, David Greene wrote: > >>> Please make BufferSize an 'unsigned' and default it to 8192. Please use >>> PRESERVE_STREAM instead of 'false'. > > Here's an updated version of the circular buffer. Ok to check in? This is looking a lot better, here are some more comments: > + /// current_pos - Return the current position within the stream, > + /// not counting the bytes currently in the...
2009 Dec 19
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...y we'll want to dump on SIGUSER1 as well but there's no generic libSystem hook for that yet. > > + /// DELETE_STREAM - Tell the destructor to delete the held > > stream. > > + /// > > + static const bool DELETE_STREAM = true; > > + > > + /// PRESERVE_STREAM - Tell the destructor to not delete the held > > + /// stream. > > + /// > > + static const bool PRESERVE_STREAM = false; > > I don't find these to be very clear names. How about giving them a > name involving 'ownership' like TAKES_OWNERSHIP? &quot...
2009 Dec 16
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Tuesday 15 December 2009 23:02, Chris Lattner wrote: > On Dec 15, 2009, at 6:33 PM, David Greene wrote: > > On Tuesday 15 December 2009 20:11, Chris Lattner wrote: > >> Please send complete and minimal patches to avoid wasting reviewer's > >> time, > > > > What do you want, complete or minimal? I don't want to pre-send 50 > > or so patches
2009 Dec 16
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Dec 15, 2009, at 6:33 PM, David Greene wrote: > On Tuesday 15 December 2009 20:11, Chris Lattner wrote: > >> Please send complete and minimal patches to avoid wasting reviewer's >> time, > > What do you want, complete or minimal? I don't want to pre-send 50 > or so patches (one per source file) that simply change errs() to dbgs(). > Thus I thought I