[cfe-commits] r85938 - /cfe/trunk/lib/Parse/ParseExpr.cpp

Douglas Gregor dgregor at apple.com
Tue Nov 3 12:53:49 PST 2009


Author: dgregor
Date: Tue Nov  3 14:53:48 2009
New Revision: 85938

URL: http://llvm.org/viewvc/llvm-project?rev=85938&view=rev
Log:
Remove a bunch of #if 0'd code made irrelevant by the latest ParseUnqualifiedId changes

Modified:
    cfe/trunk/lib/Parse/ParseExpr.cpp

Modified: cfe/trunk/lib/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=85938&r1=85937&r2=85938&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseExpr.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExpr.cpp Tue Nov  3 14:53:48 2009
@@ -982,112 +982,6 @@
                                             SS, Name, ObjCImpDecl,
                                             Tok.is(tok::l_paren));
       
-#if 0
-      if (Tok.is(tok::identifier)) {
-        if (!LHS.isInvalid())
-          LHS = Actions.ActOnMemberReferenceExpr(CurScope, move(LHS), OpLoc,
-                                                 OpKind, Tok.getLocation(),
-                                                 *Tok.getIdentifierInfo(),
-                                                 ObjCImpDecl, &SS);
-        ConsumeToken();
-      } else if (getLang().CPlusPlus && Tok.is(tok::tilde)) {
-        // We have a C++ pseudo-destructor or a destructor call, e.g., t.~T()
-
-        // Consume the tilde.
-        ConsumeToken();
-
-        if (!Tok.is(tok::identifier)) {
-          Diag(Tok, diag::err_expected_ident);
-          return ExprError();
-        }
-
-        if (NextToken().is(tok::less)) {
-          // class-name: 
-          //     ~ simple-template-id
-          TemplateTy Template 
-            = Actions.ActOnDependentTemplateName(SourceLocation(),
-                                                 *Tok.getIdentifierInfo(),   
-                                                 Tok.getLocation(),
-                                                 SS,
-                                                 ObjectType);
-          if (AnnotateTemplateIdToken(Template, TNK_Type_template, &SS, 
-                                      SourceLocation(), true))
-            return ExprError();
-          
-          assert(Tok.is(tok::annot_typename) && 
-                 "AnnotateTemplateIdToken didn't work?");
-          if (!LHS.isInvalid())
-            LHS = Actions.ActOnDestructorReferenceExpr(CurScope, move(LHS),
-                                                       OpLoc, OpKind,
-                                                       Tok.getAnnotationRange(),
-                                                       Tok.getAnnotationValue(),
-                                                       SS,
-                                                 NextToken().is(tok::l_paren));                                                                   
-        } else {
-          // class-name: 
-          //     ~ identifier
-          if (!LHS.isInvalid())
-            LHS = Actions.ActOnDestructorReferenceExpr(CurScope, move(LHS),
-                                                       OpLoc, OpKind,
-                                                       Tok.getLocation(),
-                                                       Tok.getIdentifierInfo(),
-                                                       SS,
-                                                 NextToken().is(tok::l_paren));
-        }
-        
-        // Consume the identifier or template-id token.
-        ConsumeToken();
-      } else if (getLang().CPlusPlus && Tok.is(tok::kw_operator)) {
-        // We have a reference to a member operator, e.g., t.operator int or
-        // t.operator+.
-        SourceLocation OperatorLoc = Tok.getLocation();
-        
-        if (OverloadedOperatorKind Op = TryParseOperatorFunctionId()) {
-          if (!LHS.isInvalid())
-            LHS = Actions.ActOnOverloadedOperatorReferenceExpr(CurScope,
-                                                               move(LHS), OpLoc,
-                                                               OpKind,
-                                                               OperatorLoc,
-                                                               Op, &SS);
-          // TryParseOperatorFunctionId already consumed our token, so
-          // don't bother
-        } else if (TypeTy *ConvType = ParseConversionFunctionId()) {
-          if (!LHS.isInvalid())
-            LHS = Actions.ActOnConversionOperatorReferenceExpr(CurScope,
-                                                               move(LHS), OpLoc,
-                                                               OpKind,
-                                                               OperatorLoc,
-                                                               ConvType, &SS);
-        } else {
-          // Don't emit a diagnostic; ParseConversionFunctionId does it for us
-          return ExprError();
-        }
-      } else if (getLang().CPlusPlus && Tok.is(tok::annot_template_id)) {
-        // We have a reference to a member template along with explicitly-
-        // specified template arguments, e.g., t.f<int>.
-        TemplateIdAnnotation *TemplateId
-          = static_cast<TemplateIdAnnotation *>(Tok.getAnnotationValue());
-        if (!LHS.isInvalid()) {
-          ASTTemplateArgsPtr TemplateArgsPtr(Actions,
-                                             TemplateId->getTemplateArgs(),
-                                             TemplateId->getTemplateArgIsType(),
-                                             TemplateId->NumArgs);
-
-          LHS = Actions.ActOnMemberTemplateIdReferenceExpr(CurScope, move(LHS),
-                                                           OpLoc, OpKind, SS,
-                                        TemplateTy::make(TemplateId->Template),
-                                                   TemplateId->TemplateNameLoc,
-                                                         TemplateId->LAngleLoc,
-                                                           TemplateArgsPtr,
-                                         TemplateId->getTemplateArgLocations(),
-                                                         TemplateId->RAngleLoc);
-        }
-        ConsumeToken();
-      } else {
-        Diag(Tok, diag::err_expected_ident);
-        return ExprError();
-      }
-#endif
       break;
     }
     case tok::plusplus:    // postfix-expression: postfix-expression '++'





More information about the cfe-commits mailing list