本文整理汇总了C++中Type::IsCSU方法的典型用法代码示例。如果您正苦于以下问题:C++ Type::IsCSU方法的具体用法?C++ Type::IsCSU怎么用?C++ Type::IsCSU使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Type
的用法示例。
在下文中一共展示了Type::IsCSU方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Visit
void Visit(Exp *lval)
{
// match any access which uses a GC thing type as an rvalue,
// including those where the thing is not actually dereferenced.
// we are watching not just for direct accesses to the thing,
// but to places where it is copied to arguments, a return value,
// a variable or heap location. any use of an GC thing pointer
// not protected against GC is considered to be an error, and adding
// these asserts aggressively lets us discharge reports easier and
// generate reports close to the site of the actual problem.
if (!lval->IsDrf())
return;
ExpDrf *nlval = lval->AsDrf();
Type *type = nlval->GetType();
if (type && type->IsCSU() && TypeIsGCThing(type->AsCSU())) {
AssertInfo info;
info.kind = ASK_GCSafe;
info.cls = ASC_Check;
info.point = point;
Exp *target = nlval->GetTarget();
if (target->IsFld() &&
BlockSummary::FieldIsGCSafe(target->AsFld()->GetField())) {
info.bit = Bit::MakeConstant(true);
} else {
Exp *gcsafe = Exp::MakeGCSafe(nlval->GetTarget(), false);
info.bit = Bit::MakeVar(gcsafe);
}
asserts.PushBack(info);
}
}