instead of looking up super at startup time,
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
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 1a9e1a0..dcb3af3 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -103,8 +103,6 @@
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");
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index ded90e8..db75513 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -192,9 +192,6 @@
/// 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"
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 147b4c8..12f059e 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -400,7 +400,7 @@
}
}
// 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);
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 786d74c..0684674 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -185,7 +185,7 @@
ObjCInterfaceDecl* ClassDecl = 0;
bool isSuper = false;
- if (receiverName == SuperID) {
+ if (receiverName->isStr("super")) {
if (getCurMethodDecl()) {
isSuper = true;
ClassDecl = getCurMethodDecl()->getClassInterface()->getSuperClass();