9#ifndef LLVM_SUPPORT_LINEITERATOR_H
10#define LLVM_SUPPORT_LINEITERATOR_H
34 std::optional<MemoryBufferRef> Buffer;
35 char CommentMarker =
'\0';
36 bool SkipBlanks =
true;
38 unsigned LineNumber = 1;
53 char CommentMarker =
'\0');
57 char CommentMarker =
'\0');
84 return LHS.Buffer ==
RHS.Buffer &&
85 LHS.CurrentLine.begin() ==
RHS.CurrentLine.begin();
This interface provides simple read-only access to a block of memory, and provides simple methods for...
StringRef - Represent a constant reference to a string, i.e.
A forward iterator which reads text lines from a buffer.
std::ptrdiff_t difference_type
friend bool operator!=(const line_iterator &LHS, const line_iterator &RHS)
int64_t line_number() const
Return the current line number. May return any number at EOF.
bool is_at_eof() const
Return true if we've reached EOF or are an "end" iterator.
line_iterator & operator++()
Advance to the next (non-empty, non-comment) line.
const StringRef * operator->() const
bool is_at_end() const
Return true if we're an "end" iterator or have reached EOF.
StringRef operator*() const
Get the current line as a StringRef.
friend bool operator==(const line_iterator &LHS, const line_iterator &RHS)
line_iterator()=default
Default construct an "end" iterator.
std::forward_iterator_tag iterator_category
line_iterator operator++(int)
This is an optimization pass for GlobalISel generic memory operations.