add a simplified lexer ctor that sets up the lexer to raw-lex an
entire file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62414 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Rewrite/TokenRewriter.cpp b/lib/Rewrite/TokenRewriter.cpp
index 85d83c2..aab6fb0 100644
--- a/lib/Rewrite/TokenRewriter.cpp
+++ b/lib/Rewrite/TokenRewriter.cpp
@@ -22,11 +22,8 @@
const LangOptions &LangOpts) {
ScratchBuf.reset(new ScratchBuffer(SM));
- std::pair<const char*,const char*> File = SM.getBufferData(FID);
-
// Create a lexer to lex all the tokens of the main file in raw mode.
- Lexer RawLex(SM.getLocForStartOfFile(FID),
- LangOpts, File.first, File.second);
+ Lexer RawLex(FID, SM, LangOpts);
// Return all comments and whitespace as tokens.
RawLex.SetKeepWhitespaceMode(true);