forked from OSchip/llvm-project
Start of IRGen for lambda conversion operators.
llvm-svn: 150649
This commit is contained in:
parent
b6f795eee6
commit
5a6d507d1b
|
@ -1720,3 +1720,11 @@ CodeGenFunction::EmitCXXOperatorMemberCallee(const CXXOperatorCallExpr *E,
|
|||
|
||||
return CGM.GetAddrOfFunction(MD, Ty);
|
||||
}
|
||||
|
||||
void CodeGenFunction::EmitLambdaToBlockPointerBody(FunctionArgList &Args) {
|
||||
CGM.ErrorUnsupported(CurFuncDecl, "lambda conversion to block");
|
||||
}
|
||||
|
||||
void CodeGenFunction::EmitLambdaToFunctionPointerBody(FunctionArgList &Args) {
|
||||
CGM.ErrorUnsupported(CurFuncDecl, "lambda conversion to function");
|
||||
}
|
||||
|
|
|
@ -447,6 +447,15 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn,
|
|||
!CGM.getCodeGenOpts().CUDAIsDevice &&
|
||||
FD->hasAttr<CUDAGlobalAttr>())
|
||||
CGM.getCUDARuntime().EmitDeviceStubBody(*this, Args);
|
||||
else if (isa<CXXConversionDecl>(FD) &&
|
||||
cast<CXXConversionDecl>(FD)->getParent()->isLambda()) {
|
||||
// The lambda conversion operators are special; the semantics can't be
|
||||
// expressed in the AST, so IRGen needs to special-case them.
|
||||
if (cast<CXXConversionDecl>(FD)->isLambdaToBlockPointerConversion())
|
||||
EmitLambdaToBlockPointerBody(Args);
|
||||
else
|
||||
EmitLambdaToFunctionPointerBody(Args);
|
||||
}
|
||||
else
|
||||
EmitFunctionBody(Args);
|
||||
|
||||
|
|
|
@ -1376,6 +1376,9 @@ public:
|
|||
void EmitDestructorBody(FunctionArgList &Args);
|
||||
void EmitFunctionBody(FunctionArgList &Args);
|
||||
|
||||
void EmitLambdaToBlockPointerBody(FunctionArgList &Args);
|
||||
void EmitLambdaToFunctionPointerBody(FunctionArgList &Args);
|
||||
|
||||
/// EmitReturnBlock - Emit the unified return block, trying to avoid its
|
||||
/// emission when possible.
|
||||
void EmitReturnBlock();
|
||||
|
|
Loading…
Reference in New Issue