r191646 - Remove an unnecessary overload from ASTLambda.h

Faisal Vali faisalv at yahoo.com
Sun Sep 29 13:15:45 PDT 2013


Author: faisalv
Date: Sun Sep 29 15:15:45 2013
New Revision: 191646

URL: http://llvm.org/viewvc/llvm-project?rev=191646&view=rev
Log:
Remove an unnecessary overload from ASTLambda.h 
As Richard pointed out to me, dyn_cast is very cheap - there is no real benefit from adding cluttery overloads to only avoid that cast.
No functionality change.

Modified:
    cfe/trunk/include/clang/AST/ASTLambda.h
    cfe/trunk/lib/Sema/SemaDecl.cpp

Modified: cfe/trunk/include/clang/AST/ASTLambda.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTLambda.h?rev=191646&r1=191645&r2=191646&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ASTLambda.h (original)
+++ cfe/trunk/include/clang/AST/ASTLambda.h Sun Sep 29 15:15:45 2013
@@ -45,12 +45,6 @@ inline bool isGenericLambdaCallOperatorS
   return false;
 }
 
-inline bool isGenericLambdaCallOperatorSpecialization(Decl *D) {
-  if (!D || !isa<CXXMethodDecl>(D)) return false;
-  return isGenericLambdaCallOperatorSpecialization(
-                                cast<CXXMethodDecl>(D));
-}
-
 inline bool isLambdaConversionOperator(CXXConversionDecl *C) {
   return C ? C->getParent()->isLambda() : false;
 }

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=191646&r1=191645&r2=191646&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Sun Sep 29 15:15:45 2013
@@ -9349,7 +9349,7 @@ Decl *Sema::ActOnStartOfFunctionDef(Scop
   // a LambdaScopeInfo onto the function stack.  But use the information
   // that's already been calculated (ActOnLambdaExpr) when analyzing the
   // template version, to prime the current LambdaScopeInfo. 
-  if (isGenericLambdaCallOperatorSpecialization(D)) {
+  if (isGenericLambdaCallOperatorSpecialization(FD)) {
     CXXMethodDecl *CallOperator = cast<CXXMethodDecl>(D);
     CXXRecordDecl *LambdaClass = CallOperator->getParent();
     LambdaExpr    *LE = LambdaClass->getLambdaExpr();





More information about the cfe-commits mailing list