forked from OSchip/llvm-project
parent
676268e45a
commit
8cf1f935c2
|
@ -91,12 +91,14 @@ class Preprocessor {
|
||||||
bool KeepMacroComments : 1;
|
bool KeepMacroComments : 1;
|
||||||
|
|
||||||
// State that changes while the preprocessor runs:
|
// State that changes while the preprocessor runs:
|
||||||
bool DisableMacroExpansion : 1; // True if macro expansion is disabled.
|
|
||||||
bool InMacroArgs : 1; // True if parsing fn macro invocation args.
|
bool InMacroArgs : 1; // True if parsing fn macro invocation args.
|
||||||
|
|
||||||
/// Whether the preprocessor owns the header search object.
|
/// Whether the preprocessor owns the header search object.
|
||||||
bool OwnsHeaderSearch : 1;
|
bool OwnsHeaderSearch : 1;
|
||||||
|
|
||||||
|
/// DisableMacroExpansion - True if macro expansion is disabled.
|
||||||
|
bool DisableMacroExpansion : 1;
|
||||||
|
|
||||||
/// Identifiers - This is mapping/lookup information for all identifiers in
|
/// Identifiers - This is mapping/lookup information for all identifiers in
|
||||||
/// the program, including program keywords.
|
/// the program, including program keywords.
|
||||||
mutable IdentifierTable Identifiers;
|
mutable IdentifierTable Identifiers;
|
||||||
|
|
|
@ -481,11 +481,11 @@ void Preprocessor::HandleDirective(Token &Result) {
|
||||||
CurPPLexer->ParsingPreprocessorDirective = true;
|
CurPPLexer->ParsingPreprocessorDirective = true;
|
||||||
|
|
||||||
++NumDirectives;
|
++NumDirectives;
|
||||||
|
|
||||||
// We are about to read a token. For the multiple-include optimization FA to
|
// We are about to read a token. For the multiple-include optimization FA to
|
||||||
// work, we have to remember if we had read any tokens *before* this
|
// work, we have to remember if we had read any tokens *before* this
|
||||||
// pp-directive.
|
// pp-directive.
|
||||||
bool ReadAnyTokensBeforeDirective = CurPPLexer->MIOpt.getHasReadAnyTokensVal();
|
bool ReadAnyTokensBeforeDirective =CurPPLexer->MIOpt.getHasReadAnyTokensVal();
|
||||||
|
|
||||||
// Save the '#' token in case we need to return it later.
|
// Save the '#' token in case we need to return it later.
|
||||||
Token SavedHash = Result;
|
Token SavedHash = Result;
|
||||||
|
@ -1549,8 +1549,9 @@ void Preprocessor::HandleIfdefDirective(Token &Result, bool isIfndef,
|
||||||
// Should we include the stuff contained by this directive?
|
// Should we include the stuff contained by this directive?
|
||||||
if (!MI == isIfndef) {
|
if (!MI == isIfndef) {
|
||||||
// Yes, remember that we are inside a conditional, then lex the next token.
|
// Yes, remember that we are inside a conditional, then lex the next token.
|
||||||
CurPPLexer->pushConditionalLevel(DirectiveTok.getLocation(), /*wasskip*/false,
|
CurPPLexer->pushConditionalLevel(DirectiveTok.getLocation(),
|
||||||
/*foundnonskip*/true, /*foundelse*/false);
|
/*wasskip*/false, /*foundnonskip*/true,
|
||||||
|
/*foundelse*/false);
|
||||||
} else {
|
} else {
|
||||||
// No, skip the contents of this block and return the first token after it.
|
// No, skip the contents of this block and return the first token after it.
|
||||||
SkipExcludedConditionalBlock(DirectiveTok.getLocation(),
|
SkipExcludedConditionalBlock(DirectiveTok.getLocation(),
|
||||||
|
|
Loading…
Reference in New Issue