use pointer comparison instead of isStr

llvm-svn: 101022
This commit is contained in:
Chris Lattner 2010-04-12 06:22:50 +00:00
parent cd963185f0
commit 1447136553
1 changed files with 2 additions and 3 deletions

View File

@ -641,7 +641,7 @@ Parser::OwningExprResult Parser::ParseCastExpression(bool isUnaryExpression,
if (getLang().ObjC1 && Tok.is(tok::period) &&
(Actions.getTypeName(II, ILoc, CurScope) ||
// Allow the base to be 'super' if in an objc-method.
(II.isStr("super") && CurScope->isInObjcMethodScope()))) {
(&II == Ident_super && CurScope->isInObjcMethodScope()))) {
SourceLocation DotLoc = ConsumeToken();
if (Tok.isNot(tok::identifier)) {
@ -1442,10 +1442,9 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr,
return OwningExprResult(Actions);
}
// Reject the cast of super idiom in ObjC.
if (Tok.is(tok::identifier) && getLang().ObjC1 &&
Tok.getIdentifierInfo()->isStr("super")) {
Tok.getIdentifierInfo() == Ident_super) {
Diag(Tok.getLocation(), diag::err_illegal_super_cast)
<< SourceRange(OpenLoc, RParenLoc);
return ExprError();