diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-11-20 05:41:43 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-11-20 05:41:43 +0000 |
| commit | 66e32812cd3bc9439bd36752728e8eb56993c1ae (patch) | |
| tree | 9ed5b8d9ea9593550e3552230e6a10463d9b4873 /clang/lib | |
| parent | 4500f721edff9a2e638f333921a0a4aebd801aee (diff) | |
| download | bcm5719-llvm-66e32812cd3bc9439bd36752728e8eb56993c1ae.tar.gz bcm5719-llvm-66e32812cd3bc9439bd36752728e8eb56993c1ae.zip | |
remove some other identifiers that are looked up really early and only
used in one cold place.
llvm-svn: 59709
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/Sema.cpp | 6 | ||||
| -rw-r--r-- | clang/lib/Sema/Sema.h | 4 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 20 |
3 files changed, 15 insertions, 15 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index dcb3af31b08..2b33bf4046f 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -103,12 +103,6 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer) KnownFunctionIDs[id_vsnprintf_chk] = &IT.get("__builtin___vsnprintf_chk"); KnownFunctionIDs[id_vprintf] = &IT.get("vprintf"); - // ObjC builtin typedef names. - Ident_id = &IT.get("id"); - Ident_Class = &IT.get("Class"); - Ident_SEL = &IT.get("SEL"); - Ident_Protocol = &IT.get("Protocol"); - Ident_StdNs = &IT.get("std"); Ident_TypeInfo = 0; StdNamespace = 0; diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index db75513b1a5..ab465247c89 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -192,10 +192,6 @@ public: /// This list is populated upon the creation of a Sema object. IdentifierInfo* KnownFunctionIDs[id_num_known_functions]; - /// Identifiers for builtin ObjC typedef names. - IdentifierInfo *Ident_id, *Ident_Class; // "id", "Class" - IdentifierInfo *Ident_SEL, *Ident_Protocol; // "SEL", "Protocol" - /// Identifiers used by the C++ language IdentifierInfo *Ident_StdNs; // "std" IdentifierInfo *Ident_TypeInfo; // "type_info" - lazily created diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 941f40fa52a..e7a9c0ee728 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/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; } |

