diff options
author | Chris Lattner <sabre@nondot.org> | 2007-11-02 17:26:47 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-11-02 17:26:47 +0000 |
commit | 54a2f071a37ee63d3ef1d4e7ca2570542ee12115 (patch) | |
tree | b52d7d8bfb6007ece7078a7e661ca3202da7969d | |
parent | a1ff3e9290943fef18b0a1e9888854c8fd0ba5a4 (diff) |
Expose InsertText, fixing an oversight.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43643 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | Rewrite/Rewriter.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Rewrite/Rewriter.cpp b/Rewrite/Rewriter.cpp index 894450863e..a624fcc2c1 100644 --- a/Rewrite/Rewriter.cpp +++ b/Rewrite/Rewriter.cpp @@ -201,6 +201,16 @@ RewriteBuffer &Rewriter::getEditBuffer(unsigned FileID) { return I->second; } +/// InsertText - Insert the specified string at the specified location in the +/// original buffer. This method is only valid on rewritable source +/// locations. +void Rewriter::InsertText(SourceLocation Loc, + const char *StrData, unsigned StrLen) { + unsigned FileID; + unsigned StartOffs = getLocationOffsetAndFileID(Loc, FileID); + getEditBuffer(FileID).InsertText(StartOffs, StrData, StrLen); +} + /// RemoveText - Remove the specified text region. This method is only valid /// on a rewritable source location. void Rewriter::RemoveText(SourceLocation Start, unsigned Length) { |