diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-02-16 01:37:33 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-02-16 01:37:33 +0000 |
commit | bd89f8c2caa9550e41daa1aa9bf30f0f1e0dfaf7 (patch) | |
tree | a7af0cf81ee56d0cac84f420e553c6caf49ed69e /lib/CodeGen/CodeGenFunction.cpp | |
parent | 3973accabc855b81b55bcc1945a98b2adb2ce72a (diff) |
Start of IRGen for lambda conversion operators.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150649 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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<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); |