From 1321cbbd87e8b37442050894f73f4fea3b88b0d2 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Mon, 6 Dec 2010 17:28:17 +0000 Subject: Add BlocksAttr assert on __block specific routines. llvm-svn: 121007 --- clang/lib/AST/ASTContext.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'clang/lib/AST/ASTContext.cpp') diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 6c2a77ae693..9a8b153e26f 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -1011,14 +1011,19 @@ void ASTContext::setObjCImplementation(ObjCCategoryDecl *CatD, /// \brief Get the copy initialization expression of VarDecl,or NULL if /// none exists. Expr *ASTContext::getBlockVarCopyInits(const VarDecl*VD) { + assert(VD && "Passed null params"); + assert(VD->hasAttr() && + "getBlockVarCopyInits - not __block var"); llvm::DenseMap::iterator - I = BlockVarCopyInits.find(VD); + I = BlockVarCopyInits.find(VD); return (I != BlockVarCopyInits.end()) ? cast(I->second) : 0; } /// \brief Set the copy inialization expression of a block var decl. void ASTContext::setBlockVarCopyInits(VarDecl*VD, Expr* Init) { assert(VD && Init && "Passed null params"); + assert(VD->hasAttr() && + "setBlockVarCopyInits - not __block var"); BlockVarCopyInits[VD] = Init; } -- cgit v1.2.3