diff options
author | Mike Stump <mrs@apple.com> | 2009-10-20 02:12:22 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-10-20 02:12:22 +0000 |
commit | adaaad3715c9c26cdcfdfe3401a13d7b4423ddcf (patch) | |
tree | ad2ec2fa2dd2e020251449a3537edd506bfed18d /include/clang | |
parent | 9a2c8bb599a2460807e341182655a68515574124 (diff) |
Refine the type of the first parameter to block invoke functions.
WIP. I have yet to find the magic incantation to get the structure
type to be defined. If someone has a pointer, love to hear it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84590 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/AST/ASTContext.h | 24 | ||||
-rw-r--r-- | include/clang/Frontend/PCHBitCodes.h | 4 |
2 files changed, 27 insertions, 1 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index 493d8acf3b..df480e9a36 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -144,6 +144,9 @@ class ASTContext { /// \brief The type for the C sigjmp_buf type. TypeDecl *sigjmp_bufDecl; + /// \brief Type for the Block descriptor for Blocks CodeGen. + RecordDecl *BlockDescriptorType; + /// \brief Keeps track of all declaration attributes. /// /// Since so few decls have attrs, we keep them in a hash map instead of @@ -391,6 +394,27 @@ public: /// of the specified type. QualType getBlockPointerType(QualType T); + /// This gets the struct used to keep track of the descriptor for pointer to + /// blocks. + QualType getBlockDescriptorType(); + + // Set the type for a Block descriptor type. + void setBlockDescriptorType(QualType T); + /// Get the BlockDescriptorType type, or NULL if it hasn't yet been built. + QualType getRawBlockdescriptorType() { + if (BlockDescriptorType) + return getTagDeclType(BlockDescriptorType); + return QualType(); + } + + /// This gets the struct used to keep track of pointer to blocks, complete + /// with captured variables. + QualType getBlockParmType(); + + /// This completes a type created by getBlockParmType. + void completeBlockParmType(QualType Ty, + llvm::SmallVector<const Expr *, 8> &BlockDeclRefDecls); + /// getLValueReferenceType - Return the uniqued reference to the type for an /// lvalue reference to the specified type. QualType getLValueReferenceType(QualType T); diff --git a/include/clang/Frontend/PCHBitCodes.h b/include/clang/Frontend/PCHBitCodes.h index e4161fcae6..dcabcb3187 100644 --- a/include/clang/Frontend/PCHBitCodes.h +++ b/include/clang/Frontend/PCHBitCodes.h @@ -436,7 +436,9 @@ namespace clang { /// \brief Objective-C "id" redefinition type SPECIAL_TYPE_OBJC_ID_REDEFINITION = 10, /// \brief Objective-C "Class" redefinition type - SPECIAL_TYPE_OBJC_CLASS_REDEFINITION = 11 + SPECIAL_TYPE_OBJC_CLASS_REDEFINITION = 11, + /// \brief Block descriptor type for Blocks CodeGen + SPECIAL_TYPE_BLOCK_DESCRIPTOR = 12 }; /// \brief Record codes for each kind of declaration. |