summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-02-16 01:37:33 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-02-16 01:37:33 +0000
commit5a6d507d1b21c413efd81b543a46ad1a9848e476 (patch)
treeaf3791ae837741d29bcd6cf51e27a4ebc1d62418 /clang/lib/CodeGen/CodeGenFunction.cpp
parentb6f795eee606985a5d1cac625b253465f0e959c4 (diff)
downloadbcm5719-llvm-5a6d507d1b21c413efd81b543a46ad1a9848e476.tar.gz
bcm5719-llvm-5a6d507d1b21c413efd81b543a46ad1a9848e476.zip
Start of IRGen for lambda conversion operators.
llvm-svn: 150649
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