[cfe-commits] r59709 - in /cfe/trunk/lib/Sema: Sema.cpp Sema.h SemaDecl.cpp
Chris Lattner
sabre at nondot.org
Wed Nov 19 21:41:43 PST 2008
Author: lattner
Date: Wed Nov 19 23:41:43 2008
New Revision: 59709
URL: http://llvm.org/viewvc/llvm-project?rev=59709&view=rev
Log:
remove some other identifiers that are looked up really early and only
used in one cold place.
Modified:
cfe/trunk/lib/Sema/Sema.cpp
cfe/trunk/lib/Sema/Sema.h
cfe/trunk/lib/Sema/SemaDecl.cpp
Modified: cfe/trunk/lib/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=59709&r1=59708&r2=59709&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Wed Nov 19 23:41:43 2008
@@ -103,12 +103,6 @@
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;
Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=59709&r1=59708&r2=59709&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Wed Nov 19 23:41:43 2008
@@ -192,10 +192,6 @@
/// 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
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=59709&r1=59708&r2=59709&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Nov 19 23:41:43 2008
@@ -294,17 +294,27 @@
// 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;
}
More information about the cfe-commits
mailing list