summaryrefslogtreecommitdiffstats
path: root/clang/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
commitd2a02fe840553c6d4b5826b595a83d6ab4363b6d (patch)
treeb18034bbf5c73fb92fa27994fabbcffc15cfcb97 /clang/Basic/IdentifierTable.cpp
parent806cbde53b9f4de4da9e9be80a95017078af3f00 (diff)
downloadbcm5719-llvm-d2a02fe840553c6d4b5826b595a83d6ab4363b6d.tar.gz
bcm5719-llvm-d2a02fe840553c6d4b5826b595a83d6ab4363b6d.zip
fix the second half of PR2041: __restrict is ok in c90 mode, even if
restrict isn't. llvm-svn: 47316
Diffstat (limited to 'clang/Basic/IdentifierTable.cpp')
-rw-r--r--clang/Basic/IdentifierTable.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/Basic/IdentifierTable.cpp b/clang/Basic/IdentifierTable.cpp
index f6c5f3a1af9..45d888140a2 100644
--- a/clang/Basic/IdentifierTable.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud