Displaying 10 results from an estimated 10 matches for "delete_stream".
2009 Dec 18
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...REAM_H
+#define LLVM_SUPPORT_CIRCULAR_RAW_OSTREAM_H
+
+#include "llvm/Support/raw_ostream.h"
+
+namespace llvm
+{
+ /// 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...
2009 Dec 18
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...No, it's right. It's not transferring the buffer at all. It's just
> setting the buffer size of the held 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...
2009 Dec 19
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...zero."
When it is buffering, what causes it to flush? Your current model
requires "printLog" which is not an obvious name for this, would 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&...
2009 Dec 18
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...REAM_H
+#define LLVM_SUPPORT_CIRCULAR_RAW_OSTREAM_H
+
+#include "llvm/Support/raw_ostream.h"
+
+namespace llvm
+{
+ /// 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...
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 16
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Wednesday 16 December 2009 13:19, Chris Lattner wrote:
> + int BufferSize;
> + std::vector<char> BufferArray;
> + bool DelayOutput;
> + std::vector<char>::iterator Cur;
>
> Please doxygenify these.
Ok.
> Instead of using a std::vector for BufferArray, please just new[] an array
> since it is fixed size.
Ok.
> Why is BufferSize needed with
2009 Dec 16
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Dec 16, 2009, at 8:12 AM, David Greene wrote:
>>>
>>> What, specifically, do you want reviewed before I start checking in?
>>> I'll be happy to prepare a patch that shows just that.
>>
>> I want a patch that does one thing (e.g. implements dbgs(),
>
> Ok, let's start with that. Here's the patch to add the circular raw_ostream.
This
2009 Dec 17
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...REAM_H
+#define LLVM_SUPPORT_CIRCULAR_RAW_OSTREAM_H
+
+#include "llvm/Support/raw_ostream.h"
+
+namespace llvm
+{
+ /// 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...
2009 Dec 18
4
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Friday 18 December 2009 12:28, Chris Lattner wrote:
> 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 buffer.
> > + virtual uint64_t current_pos() {
>
> I didn't notice this earlier, but is there any reason for current_pos
2009 Dec 19
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...ndler. It's important that one gets output
on a SIGTERM, SIGSGEV and other such things and I don't know that object
desctruction is guaranteed in those cases.
Eventually 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...