aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-20 05:41:43 +0000
committerChris Lattner <sabre@nondot.org>2008-11-20 05:41:43 +0000
commit2bac0f6b3724734d7bb7bf8231bd8511cb49570f (patch)
tree2ca9c5e8c5c474acd2b63537f3357d6862cfb749 /lib/Sema/SemaDecl.cpp
parent8469265156c6344fa1100a6a7bf6349acc187d9f (diff)
remove some other identifiers that are looked up really early and only
used in one cold place. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59709 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 941f40fa52..e7a9c0ee72 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -294,17 +294,27 @@ TypedefDecl *Sema::MergeTypeDefDecl(TypedefDecl *New, Decl *OldD) {
// Allow multiple definitions for ObjC built-in typedefs.
// FIXME: Verify the underlying types are equivalent!
if (getLangOptions().ObjC1) {
- const IdentifierInfo *typeIdent = New->getIdentifier();
- if (typeIdent == Ident_id) {
+ const IdentifierInfo *TypeID = New->getIdentifier();
+ switch (TypeID->getLength()) {
+ default: break;
+ case 2:
+ if (!TypeID->isStr("id"))
+ break;
Context.setObjCIdType(New);
return New;
- } else if (typeIdent == Ident_Class) {
+ case 5:
+ if (!TypeID->isStr("Class"))
+ break;
Context.setObjCClassType(New);
return New;
- } else if (typeIdent == Ident_SEL) {
+ case 3:
+ if (!TypeID->isStr("SEL"))
+ break;
Context.setObjCSelType(New);
return New;
- } else if (typeIdent == Ident_Protocol) {
+ case 8:
+ if (!TypeID->isStr("Protocol"))
+ break;
Context.setObjCProtoType(New->getUnderlyingType());
return New;
}