Fix a bug steve noticed where we warned that __attribute is an extension,

but where we didn't warn about __attribute__.

llvm-svn: 39607
This commit is contained in:
Chris Lattner 2007-06-08 17:27:55 +00:00
parent 2c1720681f
commit e8b2724017
1 changed files with 11 additions and 1 deletions

View File

@ -79,6 +79,16 @@ static void AddKeyword(const char *Keyword, unsigned KWLen,
Info.setIsExtensionToken(Flags == 1);
}
static void AddAlias(const char *Keyword, unsigned KWLen,
const char *AliaseeKeyword, unsigned AliaseeKWLen,
const LangOptions &LangOpts, IdentifierTable &Table) {
IdentifierInfo &AliasInfo = Table.get(Keyword, Keyword+KWLen);
IdentifierInfo &AliaseeInfo = Table.get(AliaseeKeyword,
AliaseeKeyword+AliaseeKWLen);
AliasInfo.setTokenID(AliaseeInfo.getTokenID());
AliasInfo.setIsExtensionToken(AliaseeInfo.isExtensionToken());
}
/// AddPPKeyword - Register a preprocessor keyword like "define" "undef" or
/// "elif".
static void AddPPKeyword(tok::PPKeywordKind PPID,
@ -128,7 +138,7 @@ void IdentifierTable::AddKeywords(const LangOptions &LangOpts) {
((FLAGS) >> C99Shift) & Mask, \
((FLAGS) >> CPPShift) & Mask, LangOpts, *this);
#define ALIAS(NAME, TOK) \
AddKeyword(NAME, strlen(NAME), tok::kw_ ## TOK, 0, 0, 0, LangOpts, *this);
AddAlias(NAME, strlen(NAME), #TOK, strlen(#TOK), LangOpts, *this);
#define PPKEYWORD(NAME) \
AddPPKeyword(tok::pp_##NAME, #NAME, strlen(#NAME), *this);
#define CXX_KEYWORD_OPERATOR(NAME, ALIAS) \