LambdaMangleContext.cpp [plain text]
#include "clang/AST/LambdaMangleContext.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclCXX.h"
using namespace clang;
unsigned LambdaMangleContext::getManglingNumber(CXXMethodDecl *CallOperator) {
const FunctionProtoType *Proto
= CallOperator->getType()->getAs<FunctionProtoType>();
ASTContext &Context = CallOperator->getASTContext();
QualType Key = Context.getFunctionType(Context.VoidTy,
Proto->arg_type_begin(),
Proto->getNumArgs(),
FunctionProtoType::ExtProtoInfo());
Key = Context.getCanonicalType(Key);
return ++ManglingNumbers[Key->castAs<FunctionProtoType>()];
}