]> granicus.if.org Git - clang/commitdiff
Add BlocksAttr assert on __block specific
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 6 Dec 2010 17:28:17 +0000 (17:28 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 6 Dec 2010 17:28:17 +0000 (17:28 +0000)
routines.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121007 91177308-0d34-0410-b5e6-96231b3b80d8

clang.xcodeproj/project.pbxproj
lib/AST/ASTContext.cpp

index 877d81e61e19d4ae059b8183e3fbd784cdecf2fd..36660f04aa4beae4d633193d3c3f8d21b12ec26c 100644 (file)
                        isa = PBXProject;
                        buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
                        compatibilityVersion = "Xcode 2.4";
-                       developmentRegion = English;
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
index 6c2a77ae6935b9803c6385f8dd81a1f33d695423..9a8b153e26fbf18d9710d164557369b91f6fb0fa 100644 (file)
@@ -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<BlocksAttr>() && 
+         "getBlockVarCopyInits - not __block var");
   llvm::DenseMap<const VarDecl*, Expr*>::iterator
-  I = BlockVarCopyInits.find(VD);
+    I = BlockVarCopyInits.find(VD);
   return (I != BlockVarCopyInits.end()) ? cast<Expr>(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<BlocksAttr>() && 
+         "setBlockVarCopyInits - not __block var");
   BlockVarCopyInits[VD] = Init;
 }