Factor a complex predicate out to a helper method.
llvm-svn: 46365
This commit is contained in:
		
							parent
							
								
									de001c186e
								
							
						
					
					
						commit
						e10c6da41e
					
				| 
						 | 
				
			
			@ -1267,9 +1267,7 @@ Parser::ExprResult Parser::ParseObjCMessageExpression() {
 | 
			
		|||
  SourceLocation LBracLoc = ConsumeBracket(); // consume '['
 | 
			
		||||
 | 
			
		||||
  // Parse receiver
 | 
			
		||||
  if (Tok.is(tok::identifier) &&
 | 
			
		||||
      (Actions.isTypeName(*Tok.getIdentifierInfo(), CurScope)
 | 
			
		||||
       || Tok.isNamedIdentifier("super"))) {
 | 
			
		||||
  if (isTokObjCMessageIdentifierReceiver()) {
 | 
			
		||||
    IdentifierInfo *ReceiverName = Tok.getIdentifierInfo();
 | 
			
		||||
    ConsumeToken();
 | 
			
		||||
    return ParseObjCMessageExpressionBody(LBracLoc, ReceiverName, 0);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -362,6 +362,17 @@ private:
 | 
			
		|||
  
 | 
			
		||||
  //===--------------------------------------------------------------------===//
 | 
			
		||||
  // Objective-C Expressions
 | 
			
		||||
  
 | 
			
		||||
  bool isTokObjCMessageIdentifierReceiver() const {
 | 
			
		||||
    if (!Tok.is(tok::identifier))
 | 
			
		||||
      return false;
 | 
			
		||||
    
 | 
			
		||||
    if (Actions.isTypeName(*Tok.getIdentifierInfo(), CurScope))
 | 
			
		||||
      return true;
 | 
			
		||||
    
 | 
			
		||||
    return Tok.isNamedIdentifier("super");
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  ExprResult ParseObjCAtExpression(SourceLocation AtLocation);
 | 
			
		||||
  ExprResult ParseObjCStringLiteral(SourceLocation AtLoc);
 | 
			
		||||
  ExprResult ParseObjCEncodeExpression(SourceLocation AtLoc);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue