summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-12-06 17:28:17 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-12-06 17:28:17 +0000
commit1321cbbd87e8b37442050894f73f4fea3b88b0d2 (patch)
treecc41ad6956b9d30c4c21d89817e0f9c2a47fc64f
parent44bbe36de66b44f7c9b7355709b62609886e287a (diff)
downloadbcm5719-llvm-1321cbbd87e8b37442050894f73f4fea3b88b0d2.tar.gz
bcm5719-llvm-1321cbbd87e8b37442050894f73f4fea3b88b0d2.zip
Add BlocksAttr assert on __block specific
routines. llvm-svn: 121007
-rw-r--r--clang/clang.xcodeproj/project.pbxproj1
-rw-r--r--clang/lib/AST/ASTContext.cpp7
2 files changed, 6 insertions, 2 deletions
diff --git a/clang/clang.xcodeproj/project.pbxproj b/clang/clang.xcodeproj/project.pbxproj
index 877d81e61e1..36660f04aa4 100644
--- a/clang/clang.xcodeproj/project.pbxproj
+++ b/clang/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/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<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;
}
OpenPOWER on IntegriCloud