本文整理汇总了C++中IvarUsageMap::find方法的典型用法代码示例。如果您正苦于以下问题:C++ IvarUsageMap::find方法的具体用法?C++ IvarUsageMap::find怎么用?C++ IvarUsageMap::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IvarUsageMap
的用法示例。
在下文中一共展示了IvarUsageMap::find方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Scan
static void Scan(IvarUsageMap& M, const Stmt *S) {
if (!S)
return;
if (const ObjCIvarRefExpr *Ex = dyn_cast<ObjCIvarRefExpr>(S)) {
const ObjCIvarDecl *D = Ex->getDecl();
IvarUsageMap::iterator I = M.find(D);
if (I != M.end())
I->second = Used;
return;
}
// Blocks can reference an instance variable of a class.
if (const BlockExpr *BE = dyn_cast<BlockExpr>(S)) {
Scan(M, BE->getBody());
return;
}
if (const PseudoObjectExpr *POE = dyn_cast<PseudoObjectExpr>(S))
for (PseudoObjectExpr::const_semantics_iterator
i = POE->semantics_begin(), e = POE->semantics_end(); i != e; ++i) {
const Expr *sub = *i;
if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(sub))
sub = OVE->getSourceExpr();
Scan(M, sub);
}
for (Stmt::const_child_iterator I=S->child_begin(),E=S->child_end(); I!=E;++I)
Scan(M, *I);
}
示例2: Scan
static void Scan(IvarUsageMap& M, ObjCPropertyImplDecl* D) {
if (!D)
return;
ObjCIvarDecl* ID = D->getPropertyIvarDecl();
if (!ID)
return;
IvarUsageMap::iterator I = M.find(ID);
if (I != M.end()) I->second = Used;
}
示例3: Scan
static void Scan(IvarUsageMap& M, const Stmt* S) {
if (!S)
return;
if (const ObjCIvarRefExpr *Ex = dyn_cast<ObjCIvarRefExpr>(S)) {
const ObjCIvarDecl *D = Ex->getDecl();
IvarUsageMap::iterator I = M.find(D);
if (I != M.end())
I->second = Used;
return;
}
// Blocks can reference an instance variable of a class.
if (const BlockExpr *BE = dyn_cast<BlockExpr>(S)) {
Scan(M, BE->getBody());
return;
}
for (Stmt::const_child_iterator I=S->child_begin(),E=S->child_end(); I!=E;++I)
Scan(M, *I);
}