aboutsummaryrefslogtreecommitdiff
path: root/Basic/IdentifierTable.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-02-19 06:46:10 +0000
committerChris Lattner <sabre@nondot.org>2008-02-19 06:46:10 +0000
commit49581f4dc324d6a183419168b01cb04e73342c07 (patch)
tree2ff6b4ad1de14e1f4247979de6b7ffeb82d59131 /Basic/IdentifierTable.cpp
parente6ea2d572d8e09670c8d143e58380bf8145b123d (diff)
fix the second half of PR2041: __restrict is ok in c90 mode, even if
restrict isn't. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47316 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Basic/IdentifierTable.cpp')
-rw-r--r--Basic/IdentifierTable.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Basic/IdentifierTable.cpp b/Basic/IdentifierTable.cpp
index f6c5f3a1af..45d888140a 100644
--- a/Basic/IdentifierTable.cpp
+++ b/Basic/IdentifierTable.cpp
@@ -91,12 +91,13 @@ static void AddKeyword(const char *Keyword, unsigned KWLen,
}
static void AddAlias(const char *Keyword, unsigned KWLen,
+ tok::TokenKind AliaseeID,
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.setTokenID(AliaseeID);
AliasInfo.setIsExtensionToken(AliaseeInfo.isExtensionToken());
}
@@ -148,7 +149,8 @@ void IdentifierTable::AddKeywords(const LangOptions &LangOpts) {
((FLAGS) >> CPP0xShift) & Mask, \
((FLAGS) >> BoolShift) & Mask, LangOpts, *this);
#define ALIAS(NAME, TOK) \
- AddAlias(NAME, strlen(NAME), #TOK, strlen(#TOK), LangOpts, *this);
+ AddAlias(NAME, strlen(NAME), tok::kw_ ## TOK, #TOK, strlen(#TOK), \
+ LangOpts, *this);
#define CXX_KEYWORD_OPERATOR(NAME, ALIAS) \
if (LangOpts.CXXOperatorNames) \
AddCXXOperatorKeyword(#NAME, strlen(#NAME), tok::ALIAS, *this);