26 return c ==
' ' || c ==
'\t' || c ==
'\f' || c ==
'\v' || c ==
'\r';
30 bool removeLineIfEmpty) {
35 unsigned RealOffset = getMappedOffset(OrigOffset,
true);
42 AddReplaceDelta(OrigOffset, -
Size);
44 if (removeLineIfEmpty) {
49 unsigned curLineStartOffs = 0;
51 for (
unsigned i = 0; i != RealOffset; ++i) {
55 curLineStartOffs = i + 1;
60 unsigned lineSize = 0;
66 if (posI !=
end() && *posI ==
'\n') {
67 Buffer.
erase(curLineStartOffs, lineSize + 1 );
79 AddReplaceDelta(curLineStartOffs, -(lineSize + 1 ));
90 unsigned RealOffset = getMappedOffset(OrigOffset, InsertAfter);
91 Buffer.
insert(RealOffset, Str.begin(), Str.end());
94 AddInsertDelta(OrigOffset, Str.size());
102 unsigned RealOffset = getMappedOffset(OrigOffset,
true);
103 Buffer.
erase(RealOffset, OrigLength);
105 if (OrigLength != NewStr.
size())
106 AddReplaceDelta(OrigOffset, NewStr.
size() - OrigLength);
static bool isWhitespaceExceptNL(unsigned char c)
Return true if this character is non-new-line whitespace: ' ', '\t', '\f', '\v', '\r'.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void RemoveText(unsigned OrigOffset, unsigned Size, bool removeLineIfEmpty=false)
RemoveText - Remove the specified text.
raw_ostream & write(raw_ostream &Stream) const
Write to Stream the result of applying all changes to the original buffer.
void InsertText(unsigned OrigOffset, StringRef Str, bool InsertAfter=true)
InsertText - Insert some text at the specified point, where the offset in the buffer is specified rel...
void ReplaceText(unsigned OrigOffset, unsigned OrigLength, StringRef NewStr)
ReplaceText - This method replaces a range of characters in the input buffer with a new string.
void insert(unsigned Offset, const char *Start, const char *End)
void erase(unsigned Offset, unsigned NumBytes)
RopePieceBTreeIterator - This class provides read-only forward iteration over bytes that are in a Rop...
StringRef - Represent a constant reference to a string, i.e.
constexpr size_t size() const
size - Get the string size.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.