the size of the last token.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43092
91177308-0d34-0410-b5e6-
96231b3b80d8
//===----------------------------------------------------------------------===//
#include "clang/Rewrite/Rewriter.h"
+#include "clang/Lex/Lexer.h"
#include "clang/Basic/SourceManager.h"
using namespace clang;
if (StartFileID != EndFileID)
return -1;
+ // Adjust the end offset to the end of the last token, instead of being the
+ // start of the last token.
+ EndOff += Lexer::MeasureTokenLength(Range.getEnd(), *SourceMgr);
+
return EndOff-StartOff;
}