diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-17 07:35:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-17 07:35:14 +0000 |
commit | 025c3a66402fb713c2d9bf5dc174ff264765379a (patch) | |
tree | 9a7d1d7292856fbe5322c27ddc30467b5e35cebe /lib/Rewrite/HTMLRewrite.cpp | |
parent | 22d91ca8d7c134eac5cc6a4869e6a84c461ad624 (diff) |
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
Diffstat (limited to 'lib/Rewrite/HTMLRewrite.cpp')
-rw-r--r-- | lib/Rewrite/HTMLRewrite.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/Rewrite/HTMLRewrite.cpp b/lib/Rewrite/HTMLRewrite.cpp index d61da4010a..68a53d364b 100644 --- a/lib/Rewrite/HTMLRewrite.cpp +++ b/lib/Rewrite/HTMLRewrite.cpp @@ -344,11 +344,8 @@ void html::SyntaxHighlight(Rewriter &R, FileID FID, Preprocessor &PP) { RewriteBuffer &RB = R.getEditBuffer(FID); const SourceManager &SourceMgr = PP.getSourceManager(); - std::pair<const char*, const char*> File = SourceMgr.getBufferData(FID); - const char *BufferStart = File.first; - - Lexer L(SourceMgr.getLocForStartOfFile(FID), - PP.getLangOptions(), File.first, File.second); + Lexer L(FID, SourceMgr, PP.getLangOptions()); + const char *BufferStart = L.getBufferStart(); // Inform the preprocessor that we want to retain comments as tokens, so we // can highlight them. |