Buffer holding rewritten source text and original-to-rewritten offset maps.
Declared in <llvm/ADT/RewriteBuffer.h>
class RewriteBuffer;
As code is rewritten, SourceBuffers from the original input with modifications get a RewriteBuffer associated with them. The RewriteBuffer captures the modified text itself as well as information used to map between SourceLocations in the original input and offsets in the RewriteBuffer. For example, if text is inserted into the buffer, any locations after the insertion point have to be mapped.
| Name | Description |
|---|---|
iterator | Const iterator over characters in the rewritten buffer. |
| Name | Description |
|---|---|
Initialize | Initialize overloads |
InsertText | Insert text at an offset relative to the original SourceBuffer. |
InsertTextAfter | Insert Str after original offset OrigOffset. |
InsertTextBefore | Insert Str before original offset OrigOffset. |
RemoveText | Remove the specified text from the buffer. |
ReplaceText | Replace a range of characters in the input buffer with a new string. |
begin | Iterator to the first character of the rewritten text. |
end | Iterator one past the last character of the rewritten text. |
size | Number of characters currently stored in the rewritten buffer. |
write | Write to Stream the result of applying all changes to the original buffer. |
| Name | Description |
|---|---|
clang::Rewriter |