aboutsummaryrefslogtreecommitdiff
path: root/include/clang/AST/DeclBase.h
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-10-08 17:01:13 +0000
committerSteve Naroff <snaroff@apple.com>2008-10-08 17:01:13 +0000
commit56ee6896f2efebffb4a2cce5a7610cdf1eddbbbe (patch)
tree27e5894e15c4faaea557fd1f88702f626aea2fed /include/clang/AST/DeclBase.h
parent178927517fa09ddbb04dc8ef725b5716c18aae21 (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 'include/clang/AST/DeclBase.h')
-rw-r--r--include/clang/AST/DeclBase.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h
index d274fd381d..1ebd25c65f 100644
--- a/include/clang/AST/DeclBase.h
+++ b/include/clang/AST/DeclBase.h
@@ -27,6 +27,7 @@ class CXXRecordDecl;
class EnumDecl;
class ObjCMethodDecl;
class ObjCInterfaceDecl;
+class BlockDecl;
/// Decl - This represents one declaration (or definition), e.g. a variable,
/// typedef, function, struct, etc.
@@ -81,6 +82,7 @@ public:
ObjCPropertyImpl,
LinkageSpec,
FileScopeAsm,
+ Block, // [DeclContext]
// For each non-leaf class, we now define a mapping to the first/last member
// of the class, to allow efficient classof.
@@ -243,6 +245,7 @@ protected:
/// EnumDecl
/// ObjCMethodDecl
/// ObjCInterfaceDecl
+/// BlockDecl
///
class DeclContext {
/// DeclKind - This indicates which class this is.
@@ -295,6 +298,7 @@ public:
bool isFunctionOrMethod() const {
switch (DeclKind) {
+ case Decl::Block:
case Decl::Function:
case Decl::CXXMethod:
case Decl::ObjCMethod:
@@ -320,6 +324,7 @@ public:
case Decl::Enum:
case Decl::ObjCMethod:
case Decl::ObjCInterface:
+ case Decl::Block:
return true;
default:
if (D->getKind() >= Decl::FunctionFirst &&
@@ -339,6 +344,7 @@ public:
static bool classof(const EnumDecl *D) { return true; }
static bool classof(const ObjCMethodDecl *D) { return true; }
static bool classof(const ObjCInterfaceDecl *D) { return true; }
+ static bool classof(const BlockDecl *D) { return true; }
private:
void EmitOutRec(llvm::Serializer& S) const;