Fix location processing of @encode: the range should include the @ sign.
@selector probably gets this wrong also.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43048 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Rewrite/Rewriter.cpp b/Rewrite/Rewriter.cpp
index 0c50b4b..87a5dea 100644
--- a/Rewrite/Rewriter.cpp
+++ b/Rewrite/Rewriter.cpp
@@ -183,7 +183,17 @@
return I->second;
}
+/// RemoveText - Remove the specified text region. This method is only valid
+/// on a rewritable source location.
+void Rewriter::RemoveText(SourceLocation Start, unsigned Length) {
+ unsigned FileID;
+ unsigned StartOffs = getLocationOffsetAndFileID(Start, FileID);
+ getEditBuffer(FileID).RemoveText(StartOffs, Length);
+}
+/// ReplaceText - This method replaces a range of characters in the input
+/// buffer with a new string. This is effectively a combined "remove/insert"
+/// operation.
void Rewriter::ReplaceText(SourceLocation Start, unsigned OrigLength,
const char *NewStr, unsigned NewLength) {
assert(isRewritable(Start) && "Not a rewritable location!");