本文整理汇总了C++中ObjCCategoryDecl::setHasSynthBitfield方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjCCategoryDecl::setHasSynthBitfield方法的具体用法?C++ ObjCCategoryDecl::setHasSynthBitfield怎么用?C++ ObjCCategoryDecl::setHasSynthBitfield使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjCCategoryDecl
的用法示例。
在下文中一共展示了ObjCCategoryDecl::setHasSynthBitfield方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: new
ObjCIvarDecl *ObjCIvarDecl::Create(ASTContext &C, ObjCContainerDecl *DC,
SourceLocation StartLoc,
SourceLocation IdLoc, IdentifierInfo *Id,
QualType T, TypeSourceInfo *TInfo,
AccessControl ac, Expr *BW,
bool synthesized) {
if (DC) {
// Ivar's can only appear in interfaces, implementations (via synthesized
// properties), and class extensions (via direct declaration, or synthesized
// properties).
//
// FIXME: This should really be asserting this:
// (isa<ObjCCategoryDecl>(DC) &&
// cast<ObjCCategoryDecl>(DC)->IsClassExtension()))
// but unfortunately we sometimes place ivars into non-class extension
// categories on error. This breaks an AST invariant, and should not be
// fixed.
assert((isa<ObjCInterfaceDecl>(DC) || isa<ObjCImplementationDecl>(DC) ||
isa<ObjCCategoryDecl>(DC)) &&
"Invalid ivar decl context!");
// Once a new ivar is created in any of class/class-extension/implementation
// decl contexts, the previously built IvarList must be rebuilt.
ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(DC);
if (!ID) {
if (ObjCImplementationDecl *IM = dyn_cast<ObjCImplementationDecl>(DC)) {
ID = IM->getClassInterface();
if (BW)
IM->setHasSynthBitfield(true);
} else {
ObjCCategoryDecl *CD = cast<ObjCCategoryDecl>(DC);
ID = CD->getClassInterface();
if (BW)
CD->setHasSynthBitfield(true);
}
}
ID->setIvarList(0);
}
return new (C) ObjCIvarDecl(DC, StartLoc, IdLoc, Id, T, TInfo,
ac, BW, synthesized);
}