From f9a9af3c3d2d88c1f1a0a1f7cadc62cb300b9d77 Mon Sep 17 00:00:00 2001 From: Faisal Vali Date: Sun, 29 Sep 2013 20:15:45 +0000 Subject: [PATCH] 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. llvm-svn: 191646 --- clang/include/clang/AST/ASTLambda.h | 6 ------ clang/lib/Sema/SemaDecl.cpp | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/clang/include/clang/AST/ASTLambda.h b/clang/include/clang/AST/ASTLambda.h index 9044878e35da..ec0a3ce830fb 100644 --- a/clang/include/clang/AST/ASTLambda.h +++ b/clang/include/clang/AST/ASTLambda.h @@ -45,12 +45,6 @@ inline bool isGenericLambdaCallOperatorSpecialization(CXXMethodDecl *MD) { return false; } -inline bool isGenericLambdaCallOperatorSpecialization(Decl *D) { - if (!D || !isa(D)) return false; - return isGenericLambdaCallOperatorSpecialization( - cast(D)); -} - inline bool isLambdaConversionOperator(CXXConversionDecl *C) { return C ? C->getParent()->isLambda() : false; } diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index b15208bc3a39..4d5d559ed530 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -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(D); CXXRecordDecl *LambdaClass = CallOperator->getParent(); LambdaExpr *LE = LambdaClass->getLambdaExpr();