forked from OSchip/llvm-project
Fix line_iterator uninitialized variable warnings. NFCI.
Allows us to auto define the default constructor as well.
This commit is contained in:
parent
81ba611e88
commit
e81b201d1b
|
@ -30,16 +30,16 @@ class MemoryBuffer;
|
||||||
/// Note that this iterator requires the buffer to be nul terminated.
|
/// Note that this iterator requires the buffer to be nul terminated.
|
||||||
class line_iterator
|
class line_iterator
|
||||||
: public std::iterator<std::forward_iterator_tag, StringRef> {
|
: public std::iterator<std::forward_iterator_tag, StringRef> {
|
||||||
const MemoryBuffer *Buffer;
|
const MemoryBuffer *Buffer = nullptr;
|
||||||
char CommentMarker;
|
char CommentMarker = '\0';
|
||||||
bool SkipBlanks;
|
bool SkipBlanks = true;
|
||||||
|
|
||||||
unsigned LineNumber;
|
unsigned LineNumber = 1;
|
||||||
StringRef CurrentLine;
|
StringRef CurrentLine;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Default construct an "end" iterator.
|
/// Default construct an "end" iterator.
|
||||||
line_iterator() : Buffer(nullptr) {}
|
line_iterator() = default;
|
||||||
|
|
||||||
/// Construct a new iterator around some memory buffer.
|
/// Construct a new iterator around some memory buffer.
|
||||||
explicit line_iterator(const MemoryBuffer &Buffer, bool SkipBlanks = true,
|
explicit line_iterator(const MemoryBuffer &Buffer, bool SkipBlanks = true,
|
||||||
|
|
Loading…
Reference in New Issue