From d016ec204c54d766c4561d43548551ffde0e6b43 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Mon, 6 Dec 2010 17:28:17 +0000 Subject: [PATCH] Add BlocksAttr assert on __block specific routines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121007 91177308-0d34-0410-b5e6-96231b3b80d8 --- clang.xcodeproj/project.pbxproj | 1 - lib/AST/ASTContext.cpp | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj index 877d81e61e..36660f04aa 100644 --- a/clang.xcodeproj/project.pbxproj +++ b/clang.xcodeproj/project.pbxproj @@ -2063,7 +2063,6 @@ isa = PBXProject; buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */; compatibilityVersion = "Xcode 2.4"; - developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 6c2a77ae69..9a8b153e26 100644 --- a/lib/AST/ASTContext.cpp +++ b/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; } -- 2.40.0