diff options
Diffstat (limited to 'clang/lib/AST/DeclCXX.cpp')
| -rw-r--r-- | clang/lib/AST/DeclCXX.cpp | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index b50aa9337fe..ccd8220a684 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -20,7 +20,6 @@ #include "clang/AST/ExprCXX.h" #include "clang/AST/TypeLoc.h" #include "clang/Basic/IdentifierTable.h" -#include "clang/Sema/SemaLambda.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallPtrSet.h" using namespace clang; @@ -931,40 +930,6 @@ bool CXXRecordDecl::isCLike() const { return isPOD() && data().HasOnlyCMembers; } -bool CXXRecordDecl::isGenericLambda() const { - return isLambda() && - getLambdaCallOperator()->getDescribedFunctionTemplate(); -} - -CXXMethodDecl* CXXRecordDecl::getLambdaCallOperator() const { - if (!isLambda()) return 0; - DeclarationName Name =
- getASTContext().DeclarationNames.getCXXOperatorName(OO_Call);
- DeclContext::lookup_const_result Calls = lookup(Name); -
- assert(!Calls.empty() && "Missing lambda call operator!");
- assert(Calls.size() == 1 && "More than one lambda call operator!");
-
- NamedDecl *CallOp = Calls.front();
- if (FunctionTemplateDecl *CallOpTmpl =
- dyn_cast<FunctionTemplateDecl>(CallOp))
- return cast<CXXMethodDecl>(CallOpTmpl->getTemplatedDecl());
- - return cast<CXXMethodDecl>(CallOp); -} - -CXXMethodDecl* CXXRecordDecl::getLambdaStaticInvoker() const { - if (!isLambda()) return 0; - DeclarationName Name =
- &getASTContext().Idents.get(getLambdaStaticInvokerName());
- DeclContext::lookup_const_result Invoker = lookup(Name); - if (Invoker.empty()) return 0;
- assert(Invoker.size() == 1 && "More than one static invoker operator!");
- CXXMethodDecl *Result = cast<CXXMethodDecl>(Invoker.front());
- return Result; - -} - void CXXRecordDecl::getCaptureFields( llvm::DenseMap<const VarDecl *, FieldDecl *> &Captures, FieldDecl *&ThisCapture) const { @@ -982,14 +947,6 @@ void CXXRecordDecl::getCaptureFields( } } -TemplateParameterList* - CXXRecordDecl::getGenericLambdaTemplateParameterList() const { - if (!isLambda()) return 0; - CXXMethodDecl *CallOp = getLambdaCallOperator(); - if (FunctionTemplateDecl *Tmpl = CallOp->getDescribedFunctionTemplate()) - return Tmpl->getTemplateParameters(); - return 0; -} static CanQualType GetConversionType(ASTContext &Context, NamedDecl *Conv) { QualType T; @@ -1536,7 +1493,7 @@ bool CXXMethodDecl::hasInlineBody() const { bool CXXMethodDecl::isLambdaStaticInvoker() const { return getParent()->isLambda() && - getParent()->getLambdaStaticInvoker() == this; + getIdentifier() && getIdentifier()->getName() == "__invoke"; } |

