17 if (*
P ==
'\r' && *(
P + 1) ==
'\n')
27 if (*
P ==
'\r' && *(
P + 1) ==
'\n') {
36 :
line_iterator(Buffer.getMemBufferRef(), SkipBlanks, CommentMarker) {}
42 CommentMarker(CommentMarker), SkipBlanks(SkipBlanks),
43 CurrentLine(Buffer.getBufferSize() ? Buffer.getBufferStart() : nullptr,
47 if (Buffer.getBufferSize()) {
48 assert(Buffer.getBufferEnd()[0] ==
'\0');
50 if (SkipBlanks || !isAtLineEnd(Buffer.getBufferStart()))
55void line_iterator::advance() {
56 assert(Buffer &&
"Cannot advance past the end!");
58 const char *Pos = CurrentLine.
end();
65 }
else if (CommentMarker ==
'\0') {
74 if (*Pos == CommentMarker)
86 Buffer = std::nullopt;
87 CurrentLine = StringRef();
97 CurrentLine = StringRef(Pos,
Length);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static bool skipIfAtLineEnd(const char *&P)
static bool isAtLineEnd(const char *P)
This interface provides simple read-only access to a block of memory, and provides simple methods for...
line_iterator()=default
Default construct an "end" iterator.
This is an optimization pass for GlobalISel generic memory operations.
Implement std::hash so that hash_code can be used in STL containers.