]> granicus.if.org Git - clang/commitdiff
Remove an unnecessary overload from ASTLambda.h
authorFaisal Vali <faisalv@yahoo.com>
Sun, 29 Sep 2013 20:15:45 +0000 (20:15 +0000)
committerFaisal Vali <faisalv@yahoo.com>
Sun, 29 Sep 2013 20:15:45 +0000 (20:15 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191646 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/ASTLambda.h
lib/Sema/SemaDecl.cpp

index 9044878e35da2977b130f6b27b135b1b7e41ba28..ec0a3ce830fb6a0ed3ea65b9f1f296f1e232279d 100644 (file)
@@ -45,12 +45,6 @@ inline bool isGenericLambdaCallOperatorSpecialization(CXXMethodDecl *MD) {
   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;
 }
index b15208bc3a390339d119581fd93f179a39abc457..4d5d559ed5302a63232b1bce776a30815d035d6f 100644 (file)
@@ -9349,7 +9349,7 @@ Decl *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Decl *D) {
   // 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();