first thing in the file.
The trick is that text replacement should go after the insert point,
not before it, because it will be replacing text after the point, not before
it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43879
91177308-0d34-0410-b5e6-
96231b3b80d8
/// operation.
void RewriteBuffer::ReplaceText(unsigned OrigOffset, unsigned OrigLength,
const char *NewStr, unsigned NewLength) {
- unsigned RealOffset = getMappedOffset(OrigOffset);
+ unsigned RealOffset = getMappedOffset(OrigOffset, true);
assert(RealOffset+OrigLength <= Buffer.size() && "Invalid location");
// Overwrite the common piece.