diff options
Diffstat (limited to 'lib/Lex/PPCaching.cpp')
-rw-r--r-- | lib/Lex/PPCaching.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Lex/PPCaching.cpp b/lib/Lex/PPCaching.cpp index 5bed51eaa4..7ba5e45afa 100644 --- a/lib/Lex/PPCaching.cpp +++ b/lib/Lex/PPCaching.cpp @@ -15,22 +15,22 @@ #include "clang/Lex/Preprocessor.h" using namespace clang; -/// EnableBacktrackAtThisPos - From the point that this method is called, and -/// until DisableBacktrack() or Backtrack() is called, the Preprocessor keeps -/// track of the lexed tokens so that a subsequent Backtrack() call will make -/// the Preprocessor re-lex the same tokens. -/// -/// Nested backtracks are allowed, meaning that EnableBacktrackAtThisPos can -/// be called multiple times and DisableBacktrack/Backtrack calls will be -/// combined with the EnableBacktrackAtThisPos calls in reverse order. +/// EnableBacktrackAtThisPos - From the point that this method is called, and
+/// until CommitBacktrackedTokens() or Backtrack() is called, the Preprocessor
+/// keeps track of the lexed tokens so that a subsequent Backtrack() call will
+/// make the Preprocessor re-lex the same tokens.
+///
+/// Nested backtracks are allowed, meaning that EnableBacktrackAtThisPos can
+/// be called multiple times and CommitBacktrackedTokens/Backtrack calls will
+/// be combined with the EnableBacktrackAtThisPos calls in reverse order.
void Preprocessor::EnableBacktrackAtThisPos() { CacheTokens = true; BacktrackPositions.push_back(CachedLexPos); EnterCachingLexMode(); } -/// DisableBacktrack - Disable the last EnableBacktrackAtThisPos() call. -void Preprocessor::DisableBacktrack() { +/// CommitBacktrackedTokens - Disable the last EnableBacktrackAtThisPos call. +void Preprocessor::CommitBacktrackedTokens() { assert(!BacktrackPositions.empty() && "EnableBacktrackAtThisPos was not called!"); BacktrackPositions.pop_back(); |