From: Argyrios Kyrtzidis Date: Sun, 24 Aug 2008 12:29:43 +0000 (+0000) Subject: Rename Preprocessor::DisableBacktrack -> Preprocessor::CommitBacktrackedTokens. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed5c38682c056c147c8a4abb748b4f285de206dd;p=clang Rename Preprocessor::DisableBacktrack -> Preprocessor::CommitBacktrackedTokens. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55281 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index fe05b07eeb..cc056ead5d 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -277,22 +277,22 @@ public: void RemoveTopOfLexerStack(); /// 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. + /// 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 DisableBacktrack/Backtrack calls will be - /// combined with the EnableBacktrackAtThisPos calls in reverse order. + /// be called multiple times and CommitBacktrackedTokens/Backtrack calls will + /// be combined with the EnableBacktrackAtThisPos calls in reverse order. /// - /// NOTE: *DO NOT* forget to call either DisableBacktrack() or Backtrack() at - /// some point after EnableBacktrackAtThisPos. If you don't, caching of tokens - /// will continue indefinitely. + /// NOTE: *DO NOT* forget to call either CommitBacktrackedTokens or Backtrack + /// at some point after EnableBacktrackAtThisPos. If you don't, caching of + /// tokens will continue indefinitely. /// void EnableBacktrackAtThisPos(); - /// DisableBacktrack - Disable the last EnableBacktrackAtThisPos() call. - void DisableBacktrack(); + /// CommitBacktrackedTokens - Disable the last EnableBacktrackAtThisPos call. + void CommitBacktrackedTokens(); /// Backtrack - Make Preprocessor re-lex the tokens that were lexed since /// EnableBacktrackAtThisPos() was previously called. 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();