PTH generation: Don't call 'EmitToken' in the loop condition. This is preparing for other changes within the loop.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64247 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/CacheTokens.cpp b/Driver/CacheTokens.cpp
index cff6dd8..f652b75 100644
--- a/Driver/CacheTokens.cpp
+++ b/Driver/CacheTokens.cpp
@@ -444,6 +444,7 @@
if (Tok.is(tok::identifier)) {
Tok.setIdentifierInfo(PP.LookUpIdentifierInfo(Tok));
+ EmitToken(Tok);
continue;
}
@@ -460,8 +461,10 @@
assert(!Tok.isAtStartOfLine());
// Did we see 'include'/'import'/'include_next'?
- if (!Tok.is(tok::identifier))
+ if (!Tok.is(tok::identifier)) {
+ EmitToken(Tok);
continue;
+ }
IdentifierInfo* II = PP.LookUpIdentifierInfo(Tok);
Tok.setIdentifierInfo(II);
@@ -491,8 +494,8 @@
case tok::pp_if:
case tok::pp_ifdef:
case tok::pp_ifndef: {
- // Ad an entry for '#if' and friends. We initially set the target index
- // to 0. This will get backpatched when we hit #endif.
+ // Add an entry for '#if' and friends. We initially set the target
+ // index to 0. This will get backpatched when we hit #endif.
PPStartCond.push_back(PPCond.size());
PPCond.push_back(std::make_pair(HashOff, 0U));
break;
@@ -530,9 +533,11 @@
break;
}
}
- }
+ }
+
+ EmitToken(Tok);
}
- while (EmitToken(Tok), Tok.isNot(tok::eof));
+ while (Tok.isNot(tok::eof));
assert(PPStartCond.empty() && "Error: imblanced preprocessor conditionals.");