diff options
author | Steve Naroff <snaroff@apple.com> | 2008-10-08 17:01:13 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-10-08 17:01:13 +0000 |
commit | 56ee6896f2efebffb4a2cce5a7610cdf1eddbbbe (patch) | |
tree | 27e5894e15c4faaea557fd1f88702f626aea2fed /lib/AST/Expr.cpp | |
parent | 178927517fa09ddbb04dc8ef725b5716c18aae21 (diff) |
- Add BlockDecl AST node.
- Modify BlockExpr to reference the BlockDecl.
This is "cleanup" necessary to improve our lookup semantics for blocks (to fix <rdar://problem/6272905> clang block rewriter: parameter to function not imported into block?).
Still some follow-up work to finish this (forthcoming).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 6cdaacd689..dfe412f4fc 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -217,6 +217,13 @@ const FunctionType *BlockExpr::getFunctionType() const { getPointeeType()->getAsFunctionType(); } +SourceLocation BlockExpr::getCaretLocation() const { + return TheBlock->getCaretLocation(); +} +const Stmt *BlockExpr::getBody() const { return TheBlock->getBody(); } +Stmt *BlockExpr::getBody() { return TheBlock->getBody(); } + + //===----------------------------------------------------------------------===// // Generic Expression Routines //===----------------------------------------------------------------------===// @@ -1400,8 +1407,8 @@ Stmt::child_iterator ObjCMessageExpr::child_end() { } // Blocks -Stmt::child_iterator BlockExpr::child_begin() { return &Body; } -Stmt::child_iterator BlockExpr::child_end() { return &Body+1; } +Stmt::child_iterator BlockExpr::child_begin() { return child_iterator(); } +Stmt::child_iterator BlockExpr::child_end() { return child_iterator(); } Stmt::child_iterator BlockDeclRefExpr::child_begin() { return child_iterator();} Stmt::child_iterator BlockDeclRefExpr::child_end() { return child_iterator(); } |