[cfe-commits] r43643 - /cfe/trunk/Rewrite/Rewriter.cpp

Chris Lattner sabre at nondot.org
Fri Nov 2 10:26:48 PDT 2007


Author: lattner
Date: Fri Nov  2 12:26:47 2007
New Revision: 43643

URL: http://llvm.org/viewvc/llvm-project?rev=43643&view=rev
Log:
Expose InsertText, fixing an oversight.

Modified:
    cfe/trunk/Rewrite/Rewriter.cpp

Modified: cfe/trunk/Rewrite/Rewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Rewrite/Rewriter.cpp?rev=43643&r1=43642&r2=43643&view=diff

==============================================================================
--- cfe/trunk/Rewrite/Rewriter.cpp (original)
+++ cfe/trunk/Rewrite/Rewriter.cpp Fri Nov  2 12:26:47 2007
@@ -201,6 +201,16 @@
   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) {





More information about the cfe-commits mailing list