diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-11-03 11:20:12 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-11-03 11:20:12 +0000 |
| commit | e81b201d1bc911be8f4635a43b800d5d721d47f8 (patch) | |
| tree | f32c437a55a081a17b3fc38e3850aaccdab744bf | |
| parent | 81ba611e88d9cf31988e84380da98a3bc0b0c138 (diff) | |
| download | bcm5719-llvm-e81b201d1bc911be8f4635a43b800d5d721d47f8.tar.gz bcm5719-llvm-e81b201d1bc911be8f4635a43b800d5d721d47f8.zip | |
Fix line_iterator uninitialized variable warnings. NFCI.
Allows us to auto define the default constructor as well.
| -rw-r--r-- | llvm/include/llvm/Support/LineIterator.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/include/llvm/Support/LineIterator.h b/llvm/include/llvm/Support/LineIterator.h index c9f10ca975a..2a1e47bfe5b 100644 --- a/llvm/include/llvm/Support/LineIterator.h +++ b/llvm/include/llvm/Support/LineIterator.h @@ -30,16 +30,16 @@ class MemoryBuffer; /// Note that this iterator requires the buffer to be nul terminated. class line_iterator : public std::iterator<std::forward_iterator_tag, StringRef> { - const MemoryBuffer *Buffer; - char CommentMarker; - bool SkipBlanks; + const MemoryBuffer *Buffer = nullptr; + char CommentMarker = '\0'; + bool SkipBlanks = true; - unsigned LineNumber; + unsigned LineNumber = 1; StringRef CurrentLine; public: /// Default construct an "end" iterator. - line_iterator() : Buffer(nullptr) {} + line_iterator() = default; /// Construct a new iterator around some memory buffer. explicit line_iterator(const MemoryBuffer &Buffer, bool SkipBlanks = true, |

