diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-04-02 08:55:10 +0000 | 
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-04-02 08:55:10 +0000 | 
| commit | 11d2b2d2bb706fca0656f2760839721bb7f6cb6f (patch) | |
| tree | d374cdca417e76f1bf101f139dba2db1d10ee8f7 /lib/Lex/PPMacroExpansion.cpp | |
| parent | c0c7bca4e5b8d12699dc93a0da49e9e4bb79671b (diff) | |
Notes
Diffstat (limited to 'lib/Lex/PPMacroExpansion.cpp')
| -rw-r--r-- | lib/Lex/PPMacroExpansion.cpp | 11 | 
1 files changed, 7 insertions, 4 deletions
| diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index ffae8ab6afb1d..1c6a5ad0ebce7 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -258,10 +258,13 @@ bool Preprocessor::HandleMacroExpandedIdentifier(Token &Identifier,                                         InstantiationEnd,Identifier.getLength());      Identifier.setLocation(Loc); -    // If this is #define X X, we must mark the result as unexpandible. -    if (IdentifierInfo *NewII = Identifier.getIdentifierInfo()) -      if (getMacroInfo(NewII) == MI) -        Identifier.setFlag(Token::DisableExpand); +    // If this is a disabled macro or #define X X, we must mark the result as +    // unexpandable. +    if (IdentifierInfo *NewII = Identifier.getIdentifierInfo()) { +      if (MacroInfo *NewMI = getMacroInfo(NewII)) +        if (!NewMI->isEnabled() || NewMI == MI) +          Identifier.setFlag(Token::DisableExpand); +    }      // Since this is not an identifier token, it can't be macro expanded, so      // we're done. | 
