本文整理汇总了C++中ObjCCategoryDecl::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjCCategoryDecl::getName方法的具体用法?C++ ObjCCategoryDecl::getName怎么用?C++ ObjCCategoryDecl::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjCCategoryDecl
的用法示例。
在下文中一共展示了ObjCCategoryDecl::getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VisitObjCContainerDecl
void USRGenerator::VisitObjCContainerDecl(ObjCContainerDecl *D) {
switch (D->getKind()) {
default:
llvm_unreachable("Invalid ObjC container.");
case Decl::ObjCInterface:
case Decl::ObjCImplementation:
GenObjCClass(D->getName());
break;
case Decl::ObjCCategory: {
ObjCCategoryDecl *CD = cast<ObjCCategoryDecl>(D);
ObjCInterfaceDecl *ID = CD->getClassInterface();
if (!ID) {
// Handle invalid code where the @interface might not
// have been specified.
// FIXME: We should be able to generate this USR even if the
// @interface isn't available.
IgnoreResults = true;
return;
}
// Specially handle class extensions, which are anonymous categories.
// We want to mangle in the location to uniquely distinguish them.
if (CD->IsClassExtension()) {
Out << "objc(ext)" << ID->getName() << '@';
GenLoc(CD);
}
else
GenObjCCategory(ID->getName(), CD->getName());
break;
}
case Decl::ObjCCategoryImpl: {
ObjCCategoryImplDecl *CD = cast<ObjCCategoryImplDecl>(D);
ObjCInterfaceDecl *ID = CD->getClassInterface();
if (!ID) {
// Handle invalid code where the @interface might not
// have been specified.
// FIXME: We should be able to generate this USR even if the
// @interface isn't available.
IgnoreResults = true;
return;
}
GenObjCCategory(ID->getName(), CD->getName());
break;
}
case Decl::ObjCProtocol:
GenObjCProtocol(cast<ObjCProtocolDecl>(D)->getName());
break;
}
}
示例2: VisitObjCContainerDecl
void USRGenerator::VisitObjCContainerDecl(ObjCContainerDecl *D) {
switch (D->getKind()) {
default:
assert(false && "Invalid ObjC container.");
case Decl::ObjCInterface:
case Decl::ObjCImplementation:
GenObjCClass(D->getName());
break;
case Decl::ObjCCategory: {
ObjCCategoryDecl *CD = cast<ObjCCategoryDecl>(D);
ObjCInterfaceDecl *ID = CD->getClassInterface();
if (!ID) {
// Handle invalid code where the @interface might not
// have been specified.
// FIXME: We should be able to generate this USR even if the
// @interface isn't available.
IgnoreResults = true;
return;
}
GenObjCCategory(ID->getName(), CD->getName());
break;
}
case Decl::ObjCCategoryImpl: {
ObjCCategoryImplDecl *CD = cast<ObjCCategoryImplDecl>(D);
ObjCInterfaceDecl *ID = CD->getClassInterface();
if (!ID) {
// Handle invalid code where the @interface might not
// have been specified.
// FIXME: We should be able to generate this USR even if the
// @interface isn't available.
IgnoreResults = true;
return;
}
GenObjCCategory(ID->getName(), CD->getName());
break;
}
case Decl::ObjCProtocol:
GenObjCProtocol(cast<ObjCProtocolDecl>(D)->getName());
break;
}
}