summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-10-12 01:15:46 +0000
committerChris Lattner <sabre@nondot.org>2008-10-12 01:15:46 +0000
commit50c9050037a1388072f8efaed98e1dc8050bedb4 (patch)
tree3a2a64f5271516e92fa7b8c16d13f5a01336dfd9 /clang/lib/Rewrite
parent5d3e26a4f68c38fd98014a5344e6bb4095c38eac (diff)
downloadbcm5719-llvm-50c9050037a1388072f8efaed98e1dc8050bedb4.tar.gz
bcm5719-llvm-50c9050037a1388072f8efaed98e1dc8050bedb4.zip
Change how raw lexers are handled: instead of creating them and then
using LexRawToken, create one and use LexFromRawLexer. This avoids twiddling the RawLexer flag around and simplifies some code (even speeding raw lexing up a tiny bit). This change also improves the token paster to use a Lexer on the stack instead of new/deleting it. llvm-svn: 57393
Diffstat (limited to 'clang/lib/Rewrite')
-rw-r--r--clang/lib/Rewrite/HTMLRewrite.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Rewrite/HTMLRewrite.cpp b/clang/lib/Rewrite/HTMLRewrite.cpp
index b411e568f6d..67afc08b9fd 100644
--- a/clang/lib/Rewrite/HTMLRewrite.cpp
+++ b/clang/lib/Rewrite/HTMLRewrite.cpp
@@ -357,7 +357,7 @@ void html::SyntaxHighlight(Rewriter &R, unsigned FileID, Preprocessor &PP) {
// Lex all the tokens in raw mode, to avoid entering #includes or expanding
// macros.
Token Tok;
- L.LexRawToken(Tok);
+ L.LexFromRawLexer(Tok);
while (Tok.isNot(tok::eof)) {
// Since we are lexing unexpanded tokens, all tokens are from the main
@@ -398,10 +398,10 @@ void html::SyntaxHighlight(Rewriter &R, unsigned FileID, Preprocessor &PP) {
// Eat all of the tokens until we get to the next one at the start of
// line.
unsigned TokEnd = TokOffs+TokLen;
- L.LexRawToken(Tok);
+ L.LexFromRawLexer(Tok);
while (!Tok.isAtStartOfLine() && Tok.isNot(tok::eof)) {
TokEnd = SourceMgr.getFullFilePos(Tok.getLocation())+Tok.getLength();
- L.LexRawToken(Tok);
+ L.LexFromRawLexer(Tok);
}
// Find end of line. This is a hack.
@@ -413,7 +413,7 @@ void html::SyntaxHighlight(Rewriter &R, unsigned FileID, Preprocessor &PP) {
}
}
- L.LexRawToken(Tok);
+ L.LexFromRawLexer(Tok);
}
}
OpenPOWER on IntegriCloud