зеркало из https://github.com/microsoft/clang-1.git
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
This commit is contained in:
Родитель
d8c02929fe
Коммит
e4f6b1ef01
|
@ -444,6 +444,7 @@ PCHEntry PTHWriter::LexTokens(Lexer& L) {
|
||||||
|
|
||||||
if (Tok.is(tok::identifier)) {
|
if (Tok.is(tok::identifier)) {
|
||||||
Tok.setIdentifierInfo(PP.LookUpIdentifierInfo(Tok));
|
Tok.setIdentifierInfo(PP.LookUpIdentifierInfo(Tok));
|
||||||
|
EmitToken(Tok);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -460,8 +461,10 @@ PCHEntry PTHWriter::LexTokens(Lexer& L) {
|
||||||
assert(!Tok.isAtStartOfLine());
|
assert(!Tok.isAtStartOfLine());
|
||||||
|
|
||||||
// Did we see 'include'/'import'/'include_next'?
|
// Did we see 'include'/'import'/'include_next'?
|
||||||
if (!Tok.is(tok::identifier))
|
if (!Tok.is(tok::identifier)) {
|
||||||
|
EmitToken(Tok);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
IdentifierInfo* II = PP.LookUpIdentifierInfo(Tok);
|
IdentifierInfo* II = PP.LookUpIdentifierInfo(Tok);
|
||||||
Tok.setIdentifierInfo(II);
|
Tok.setIdentifierInfo(II);
|
||||||
|
@ -491,8 +494,8 @@ PCHEntry PTHWriter::LexTokens(Lexer& L) {
|
||||||
case tok::pp_if:
|
case tok::pp_if:
|
||||||
case tok::pp_ifdef:
|
case tok::pp_ifdef:
|
||||||
case tok::pp_ifndef: {
|
case tok::pp_ifndef: {
|
||||||
// Ad an entry for '#if' and friends. We initially set the target index
|
// Add an entry for '#if' and friends. We initially set the target
|
||||||
// to 0. This will get backpatched when we hit #endif.
|
// index to 0. This will get backpatched when we hit #endif.
|
||||||
PPStartCond.push_back(PPCond.size());
|
PPStartCond.push_back(PPCond.size());
|
||||||
PPCond.push_back(std::make_pair(HashOff, 0U));
|
PPCond.push_back(std::make_pair(HashOff, 0U));
|
||||||
break;
|
break;
|
||||||
|
@ -530,9 +533,11 @@ PCHEntry PTHWriter::LexTokens(Lexer& L) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EmitToken(Tok);
|
||||||
}
|
}
|
||||||
while (EmitToken(Tok), Tok.isNot(tok::eof));
|
while (Tok.isNot(tok::eof));
|
||||||
|
|
||||||
assert(PPStartCond.empty() && "Error: imblanced preprocessor conditionals.");
|
assert(PPStartCond.empty() && "Error: imblanced preprocessor conditionals.");
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче