summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-08-10 13:15:22 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-08-10 13:15:22 +0000
commitb3dd1e0889fa8d41ed30620b37800d58228cba94 (patch)
tree79cb1e9aadf9aae3d0f1eb33175749086cd3ff82 /clang/lib/Lex/Preprocessor.cpp
parent07bb087ac1aa5075081d93be440d74d5ddda0d6a (diff)
downloadbcm5719-llvm-b3dd1e0889fa8d41ed30620b37800d58228cba94.tar.gz
bcm5719-llvm-b3dd1e0889fa8d41ed30620b37800d58228cba94.zip
Allow the preprocessor to cache the lexed tokens, so that we can do efficient lookahead and backtracking.
1) New public methods added: -EnableBacktrackAtThisPos -DisableBacktrack -Backtrack -isBacktrackEnabled 2) LookAhead() implementation is replaced with a more efficient one. 3) LookNext() is removed. llvm-svn: 54611
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 631b8361e90..33c94b6e8ad 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -68,6 +68,9 @@ Preprocessor::Preprocessor(Diagnostic &diags, const LangOptions &opts,
InMacroArgs = false;
NumCachedTokenLexers = 0;
+ CacheTokens = false;
+ CachedLexPos = 0;
+
// "Poison" __VA_ARGS__, which can only appear in the expansion of a macro.
// This gets unpoisoned where it is allowed.
(Ident__VA_ARGS__ = getIdentifierInfo("__VA_ARGS__"))->setIsPoisoned();
@@ -579,4 +582,3 @@ void Preprocessor::HandleIdentifier(Token &Identifier) {
if (II.isExtensionToken() && Features.C99)
Diag(Identifier, diag::ext_token_used);
}
-
OpenPOWER on IntegriCloud