diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-02-22 05:02:47 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-02-22 05:02:47 +0000 |
commit | ac1303eca6cbe3e623fb5ec6fe7ec184ef4b0dfa (patch) | |
tree | 722f199bf702a2292747f89396b3c066869c3e85 /lib/AST/Expr.cpp | |
parent | e9ee382c32a83e9807a2fe4cfd52b5a11169a4b8 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151131 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 75c450867b..f95ca17306 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -1076,6 +1076,11 @@ void CastExpr::CheckCastConsistency() const { !getSubExpr()->getType()->isBlockPointerType()); goto CheckNoBasePath; + case CK_CopyAndAutoreleaseBlockObject: + assert(getType()->isBlockPointerType()); + assert(getSubExpr()->getType()->isBlockPointerType()); + goto CheckNoBasePath; + // These should not have an inheritance path. case CK_Dynamic: case CK_ToUnion: @@ -1231,6 +1236,8 @@ const char *CastExpr::getCastKindName() const { return "AtomicToNonAtomic"; case CK_NonAtomicToAtomic: return "NonAtomicToAtomic"; + case CK_CopyAndAutoreleaseBlockObject: + return "CopyAndAutoreleaseBlockObject"; } llvm_unreachable("Unhandled cast kind!"); |