Revert "Implement a rudimentary form of generic lambdas."

This reverts commit 606f5d7a99b11957e057e4cd1f55f931f66a42c7.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189004 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp
index b50aa93..ccd8220 100644
--- a/lib/AST/DeclCXX.cpp
+++ b/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 @@
   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 @@
   }
 }
 
-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::isLambdaStaticInvoker() const {
   return getParent()->isLambda() && 
-         getParent()->getLambdaStaticInvoker() == this;
+         getIdentifier() && getIdentifier()->getName() == "__invoke";
 }