Skip to content
Snippets Groups Projects
Commit bff73f7f authored by Argyrios Kyrtzidis's avatar Argyrios Kyrtzidis
Browse files

Change line endings: CRLF -> LF

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55235 91177308-0d34-0410-b5e6-96231b3b80d8
parent 0a04d77b
No related branches found
No related tags found
No related merge requests found
...@@ -15,37 +15,37 @@ ...@@ -15,37 +15,37 @@
#include "clang/Lex/Preprocessor.h" #include "clang/Lex/Preprocessor.h"
using namespace clang; using namespace clang;
/// EnableBacktrackAtThisPos - From the point that this method is called, and /// EnableBacktrackAtThisPos - From the point that this method is called, and
/// until DisableBacktrack() or Backtrack() is called, the Preprocessor keeps /// until DisableBacktrack() or Backtrack() is called, the Preprocessor keeps
/// track of the lexed tokens so that a subsequent Backtrack() call will make /// track of the lexed tokens so that a subsequent Backtrack() call will make
/// the Preprocessor re-lex the same tokens. /// the Preprocessor re-lex the same tokens.
/// ///
/// Nested backtracks are allowed, meaning that EnableBacktrackAtThisPos can /// Nested backtracks are allowed, meaning that EnableBacktrackAtThisPos can
/// be called multiple times and DisableBacktrack/Backtrack calls will be /// be called multiple times and DisableBacktrack/Backtrack calls will be
/// combined with the EnableBacktrackAtThisPos calls in reverse order. /// combined with the EnableBacktrackAtThisPos calls in reverse order.
void Preprocessor::EnableBacktrackAtThisPos() { void Preprocessor::EnableBacktrackAtThisPos() {
CacheTokens = true; CacheTokens = true;
BacktrackPositions.push_back(CachedLexPos); BacktrackPositions.push_back(CachedLexPos);
EnterCachingLexMode(); EnterCachingLexMode();
} }
/// DisableBacktrack - Disable the last EnableBacktrackAtThisPos() call. /// DisableBacktrack - Disable the last EnableBacktrackAtThisPos() call.
void Preprocessor::DisableBacktrack() { void Preprocessor::DisableBacktrack() {
assert(!BacktrackPositions.empty() assert(!BacktrackPositions.empty()
&& "EnableBacktrackAtThisPos was not called!"); && "EnableBacktrackAtThisPos was not called!");
BacktrackPositions.pop_back(); BacktrackPositions.pop_back();
CacheTokens = !BacktrackPositions.empty(); CacheTokens = !BacktrackPositions.empty();
} }
/// Backtrack - Make Preprocessor re-lex the tokens that were lexed since /// Backtrack - Make Preprocessor re-lex the tokens that were lexed since
/// EnableBacktrackAtThisPos() was previously called. /// EnableBacktrackAtThisPos() was previously called.
void Preprocessor::Backtrack() { void Preprocessor::Backtrack() {
assert(!BacktrackPositions.empty() assert(!BacktrackPositions.empty()
&& "EnableBacktrackAtThisPos was not called!"); && "EnableBacktrackAtThisPos was not called!");
CachedLexPos = BacktrackPositions.back(); CachedLexPos = BacktrackPositions.back();
BacktrackPositions.pop_back(); BacktrackPositions.pop_back();
CacheTokens = !BacktrackPositions.empty(); CacheTokens = !BacktrackPositions.empty();
} }
void Preprocessor::CachingLex(Token &Result) { void Preprocessor::CachingLex(Token &Result) {
if (CachedLexPos < CachedTokens.size()) { if (CachedLexPos < CachedTokens.size()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment