From bd89f8c2caa9550e41daa1aa9bf30f0f1e0dfaf7 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 16 Feb 2012 01:37:33 +0000 Subject: Start of IRGen for lambda conversion operators. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150649 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenFunction.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/CodeGen/CodeGenFunction.cpp') diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 0c528b2cb0..1034de736c 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -447,6 +447,15 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn, !CGM.getCodeGenOpts().CUDAIsDevice && FD->hasAttr()) CGM.getCUDARuntime().EmitDeviceStubBody(*this, Args); + else if (isa(FD) && + cast(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(FD)->isLambdaToBlockPointerConversion()) + EmitLambdaToBlockPointerBody(Args); + else + EmitLambdaToFunctionPointerBody(Args); + } else EmitFunctionBody(Args); -- cgit v1.2.3-18-g5258