cleanup context-sensitive objc keyword recognition. Patch by Fariborz Jahanian.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41583 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Parse/ParseObjc.cpp b/Parse/ParseObjc.cpp
index 4b3c600..7c0f842 100644
--- a/Parse/ParseObjc.cpp
+++ b/Parse/ParseObjc.cpp
@@ -303,13 +303,11 @@
/// objc-type-qualifier: one of
/// in out inout bycopy byref oneway
///
-/// FIXME: remove the string compares...
bool Parser::isObjCTypeQualifier() {
if (Tok.getKind() == tok::identifier) {
- const char *qual = Tok.getIdentifierInfo()->getName();
- return (strcmp(qual, "in") == 0) || (strcmp(qual, "out") == 0) ||
- (strcmp(qual, "inout") == 0) || (strcmp(qual, "oneway") == 0) ||
- (strcmp(qual, "bycopy") == 0) || (strcmp(qual, "byref") == 0);
+ const IdentifierInfo *II = Tok.getIdentifierInfo();
+ for (unsigned i = 0; i < objc_NumQuals; ++i)
+ if (II == ObjcTypeQuals[i]) return true;
}
return false;
}