本文整理汇总了C++中QualifiedType::containsReferenceType方法的典型用法代码示例。如果您正苦于以下问题:C++ QualifiedType::containsReferenceType方法的具体用法?C++ QualifiedType::containsReferenceType怎么用?C++ QualifiedType::containsReferenceType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QualifiedType
的用法示例。
在下文中一共展示了QualifiedType::containsReferenceType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: genFunction
//.........这里部分代码省略.........
}
// If this function needs to make allocations, cache a copy of the
// allocation context pointer for this thread, since it can on some
// platforms be expensive to look up.
if (fdef->flags() & FunctionDefn::MakesAllocs) {
Function * gcGetAllocContext = genFunctionValue(gc_allocContext);
gcAllocContext_ = builder_.CreateCall(gcGetAllocContext, "allocCtx");
}
for (; it != f->arg_end(); ++it, ++param_index) {
// Set the name of the Nth parameter
ParameterDefn * param = ftype->params()[param_index];
DASSERT_OBJ(param != NULL, fdef);
DASSERT_OBJ(param->storageClass() == Storage_Local, param);
QualifiedType paramType = param->internalType();
it->setName(param->name());
Value * paramValue = it;
// If the parameter is a shared reference, then create the shared ref.
if (param->isSharedRef()) {
genLocalVar(param, paramValue);
genGCRoot(param->irValue(), param->sharedRefType(), param->name());
continue;
}
// If the parameter type contains any reference types, then the parameter needs
// to be a root.
bool paramIsRoot = false;
if (paramType->isReferenceType()) {
param->setFlag(ParameterDefn::LValueParam, true);
paramIsRoot = true;
} else if (paramType->containsReferenceType()) {
// TODO: Handle roots of various shapes
//param->setFlag(ParameterDefn::LValueParam, true);
}
// See if we need to make a local copy of the param.
if (param->isLValue()) {
Value * paramAlloca = builder_.CreateAlloca(paramType->irEmbeddedType(), 0, param->name());
param->setIRValue(paramAlloca);
if (paramType->typeShape() == Shape_Large_Value) {
paramValue = builder_.CreateLoad(paramValue);
}
builder_.CreateStore(paramValue, paramAlloca);
if (paramIsRoot) {
genGCRoot(paramAlloca, paramType.unqualified(), param->name());
}
} else {
param->setIRValue(paramValue);
}
}
// Generate the body
Function * saveFn = currentFn_;
currentFn_ = f;
#if 0
if (fdef->isGenerator()) {
assert(false);
} else {
#endif
genLocalStorage(fdef->localScopes());
genDISubprogramStart(fdef);