fix a minor bug I noticed while work with Jordy's patch for PR6101,

in an input file like this:

# 42
int x;

we were emitting:

# <something>
 int x;

(with a space before the int) because we weren't clearing the leading 
whitespace flag properly after the \n from the directive was handled.

llvm-svn: 101084
This commit is contained in:
Chris Lattner 2010-04-12 23:04:41 +00:00
parent 11862a6ed3
commit 1a9e873bf9
1 changed files with 4 additions and 2 deletions

View File

@ -1874,9 +1874,10 @@ LexNextToken:
if (PP->isCurrentLexer(this)) {
// Start a new token. If this is a #include or something, the PP may
// want us starting at the beginning of the line again. If so, set
// the StartOfLine flag.
// the StartOfLine flag and clear LeadingSpace.
if (IsAtStartOfLine) {
Result.setFlag(Token::StartOfLine);
Result.clearFlag(Token::LeadingSpace);
IsAtStartOfLine = false;
}
goto LexNextToken; // GCC isn't tail call eliminating.
@ -2024,9 +2025,10 @@ LexNextToken:
if (PP->isCurrentLexer(this)) {
// Start a new token. If this is a #include or something, the PP may
// want us starting at the beginning of the line again. If so, set
// the StartOfLine flag.
// the StartOfLine flag and clear LeadingSpace.
if (IsAtStartOfLine) {
Result.setFlag(Token::StartOfLine);
Result.clearFlag(Token::LeadingSpace);
IsAtStartOfLine = false;
}
goto LexNextToken; // GCC isn't tail call eliminating.