summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-02-22 05:02:47 +0000
committerDouglas Gregor <dgregor@apple.com>2012-02-22 05:02:47 +0000
commited90df38004678cf1ebf1caa3fbac8a0047be73e (patch)
tree49750c16f2a1c4babf5601c2fe1be8f433583542 /clang/lib/Sema/SemaChecking.cpp
parent7cd4a9ba48c08d3804316815c0b5250d4b0bbbe7 (diff)
downloadbcm5719-llvm-ed90df38004678cf1ebf1caa3fbac8a0047be73e.tar.gz
bcm5719-llvm-ed90df38004678cf1ebf1caa3fbac8a0047be73e.zip
Generate an AST for the conversion from a lambda closure type to a
block pointer that returns a block literal which captures (by copy) the lambda closure itself. Some aspects of the block literal are left unspecified, namely the capture variable (which doesn't actually exist) and the body (which will be filled in by IRgen because it can't be written as an AST). Because we're switching to this model, this patch also eliminates tracking the copy-initialization expression for the block capture of the conversion function, since that information is now embedded in the synthesized block literal. -1 side tables FTW. llvm-svn: 151131
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 9454a751550..7f42b2059d7 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -3000,9 +3000,11 @@ static Expr *EvalAddr(Expr *E, SmallVectorImpl<DeclRefExpr *> &refVars) {
Expr* SubExpr = cast<CastExpr>(E)->getSubExpr();
QualType T = SubExpr->getType();
- if (SubExpr->getType()->isPointerType() ||
- SubExpr->getType()->isBlockPointerType() ||
- SubExpr->getType()->isObjCQualifiedIdType())
+ if (cast<CastExpr>(E)->getCastKind() == CK_CopyAndAutoreleaseBlockObject)
+ return 0;
+ else if (SubExpr->getType()->isPointerType() ||
+ SubExpr->getType()->isBlockPointerType() ||
+ SubExpr->getType()->isObjCQualifiedIdType())
return EvalAddr(SubExpr, refVars);
else if (T->isArrayType())
return EvalVal(SubExpr, refVars);
OpenPOWER on IntegriCloud