summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 0c528b2cb07..1034de736c1 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<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);
OpenPOWER on IntegriCloud