]> granicus.if.org Git - clang/commitdiff
instead of looking up super at startup time,
authorChris Lattner <sabre@nondot.org>
Thu, 20 Nov 2008 05:35:30 +0000 (05:35 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 20 Nov 2008 05:35:30 +0000 (05:35 +0000)
just check for it when needed.  It doesn't incur real cost
in any hot paths.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59708 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.cpp
lib/Sema/Sema.h
lib/Sema/SemaExpr.cpp
lib/Sema/SemaExprObjC.cpp

index 1a9e1a062c33f82e030a467f14fee77d580ee4d8..dcb3af31b08fdea7fa1e02b7da442c2eb2d527b4 100644 (file)
@@ -103,8 +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");
 
-  SuperID = &IT.get("super");
-
   // ObjC builtin typedef names.
   Ident_id = &IT.get("id");
   Ident_Class = &IT.get("Class");
index ded90e8103da0cb76c3cc9be2a4e48ac5053c027..db75513b1a54e5b9e7774f7485302f9b8bef06d8 100644 (file)
@@ -192,9 +192,6 @@ public:
   /// This list is populated upon the creation of a Sema object.    
   IdentifierInfo* KnownFunctionIDs[id_num_known_functions];
 
-  /// SuperID - Identifier for "super" used for Objective-C checking.
-  IdentifierInfo* SuperID;
-
   /// Identifiers for builtin ObjC typedef names.
   IdentifierInfo *Ident_id, *Ident_Class;     // "id", "Class"
   IdentifierInfo *Ident_SEL, *Ident_Protocol; // "SEL", "Protocol"
index 147b4c8323d6a52c0b5556db0e8f06c56bf94b57..12f059e11ac88ecb1db49fed11bb81806cc0117f 100644 (file)
@@ -400,7 +400,7 @@ Sema::ExprResult Sema::ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc,
       }
     }
     // Needed to implement property "super.method" notation.
-    if (SD == 0 && II == SuperID) {
+    if (SD == 0 && II->isStr("super")) {
       QualType T = Context.getPointerType(Context.getObjCInterfaceType(
                      getCurMethodDecl()->getClassInterface()));
       return new ObjCSuperExpr(Loc, T);
index 786d74c9507b83960904e3923a0cdd98ddd39d62..0684674c3504c7d8b91378fd3b2442dd782ffe5e 100644 (file)
@@ -185,7 +185,7 @@ Sema::ExprResult Sema::ActOnClassMessage(
   ObjCInterfaceDecl* ClassDecl = 0;
   bool isSuper = false;
   
-  if (receiverName == SuperID) {
+  if (receiverName->isStr("super")) {
     if (getCurMethodDecl()) {
       isSuper = true;
       ClassDecl = getCurMethodDecl()->getClassInterface()->getSuperClass();