diff options
author | John McCall <rjmccall@apple.com> | 2013-05-03 17:11:14 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2013-05-03 17:11:14 +0000 |
commit | 000817b3b2ab95c5b9cbb76950cd01b79fe93f55 (patch) | |
tree | cd76cda7bf87c187f3b977e92b9151ad08f5e767 /lib/AST | |
parent | 37b773f8aee9351ae3bcbddb867c54c3e8d0bfbd (diff) |
Micro-optimization: check the overloaded operator kind before
checking for a lambda.
Thanks to Jordan for the pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181031 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST')
-rw-r--r-- | lib/AST/DeclBase.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 8549b17137..c1fbdb996d 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -712,8 +712,8 @@ static Decl::Kind getKind(const DeclContext *DC) { return DC->getDeclKind(); } template <class T> static Decl *getNonClosureContext(T *D) { if (getKind(D) == Decl::CXXMethod) { CXXMethodDecl *MD = cast<CXXMethodDecl>(D); - if (MD->getParent()->isLambda() && - MD->getOverloadedOperator() == OO_Call) + if (MD->getOverloadedOperator() == OO_Call && + MD->getParent()->isLambda()) return getNonClosureContext(MD->getParent()->getParent()); return MD; } else if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { |