From 5a6d507d1b21c413efd81b543a46ad1a9848e476 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. llvm-svn: 150649 --- clang/lib/CodeGen/CodeGenFunction.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 0c528b2..1034de7 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/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.1