本文整理汇总了C++中AnyFunctionRef::getAsDeclContext方法的典型用法代码示例。如果您正苦于以下问题:C++ AnyFunctionRef::getAsDeclContext方法的具体用法?C++ AnyFunctionRef::getAsDeclContext怎么用?C++ AnyFunctionRef::getAsDeclContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnyFunctionRef
的用法示例。
在下文中一共展示了AnyFunctionRef::getAsDeclContext方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: emitProlog
void SILGenFunction::emitProlog(AnyFunctionRef TheClosure,
ArrayRef<ParameterList*> paramPatterns,
Type resultType) {
unsigned ArgNo =
emitProlog(paramPatterns, resultType, TheClosure.getAsDeclContext());
// Emit the capture argument variables. These are placed last because they
// become the first curry level of the SIL function.
auto captureInfo = SGM.Types.getLoweredLocalCaptures(TheClosure);
for (auto capture : captureInfo.getCaptures()) {
if (capture.isDynamicSelfMetadata()) {
auto selfMetatype = MetatypeType::get(
captureInfo.getDynamicSelfType()->getSelfType(),
MetatypeRepresentation::Thick)
->getCanonicalType();
SILType ty = SILType::getPrimitiveObjectType(selfMetatype);
SILValue val = new (SGM.M) SILArgument(F.begin(), ty);
(void) val;
return;
}
emitCaptureArguments(*this, capture, ++ArgNo);
}
}
示例2: emitProlog
void SILGenFunction::emitProlog(AnyFunctionRef TheClosure,
ArrayRef<ParameterList*> paramPatterns,
Type resultType) {
unsigned ArgNo =
emitProlog(paramPatterns, resultType, TheClosure.getAsDeclContext());
// Emit the capture argument variables. These are placed last because they
// become the first curry level of the SIL function.
auto captureInfo = SGM.Types.getLoweredLocalCaptures(TheClosure);
for (auto capture : captureInfo.getCaptures())
emitCaptureArguments(*this, capture, ++ArgNo);
}
示例3: emitProlog
void SILGenFunction::emitProlog(AnyFunctionRef TheClosure,
ArrayRef<ParameterList*> paramPatterns,
Type resultType, bool throws) {
uint16_t ArgNo = emitProlog(paramPatterns, resultType,
TheClosure.getAsDeclContext(), throws);
// Emit the capture argument variables. These are placed last because they
// become the first curry level of the SIL function.
auto captureInfo = SGM.Types.getLoweredLocalCaptures(TheClosure);
for (auto capture : captureInfo.getCaptures()) {
if (capture.isDynamicSelfMetadata()) {
auto selfMetatype = MetatypeType::get(
captureInfo.getDynamicSelfType());
SILType ty = getLoweredType(selfMetatype);
SILValue val = F.begin()->createFunctionArgument(ty);
(void) val;
return;
}
emitCaptureArguments(*this, TheClosure, capture, ++ArgNo);
}
}
示例4: emitProlog
void SILGenFunction::emitProlog(AnyFunctionRef TheClosure,
ParameterList *paramList,
ParamDecl *selfParam,
Type resultType, bool throws) {
uint16_t ArgNo = emitProlog(paramList, selfParam, resultType,
TheClosure.getAsDeclContext(), throws);
// Emit an unreachable instruction if a parameter type is
// uninhabited
if (paramList) {
for (auto *param : *paramList) {
if (param->getType()->isStructurallyUninhabited()) {
SILLocation unreachableLoc(param);
unreachableLoc.markAsPrologue();
B.createUnreachable(unreachableLoc);
break;
}
}
}
// Emit the capture argument variables. These are placed last because they
// become the first curry level of the SIL function.
auto captureInfo = SGM.Types.getLoweredLocalCaptures(TheClosure);
for (auto capture : captureInfo.getCaptures()) {
if (capture.isDynamicSelfMetadata()) {
auto selfMetatype = MetatypeType::get(
captureInfo.getDynamicSelfType());
SILType ty = getLoweredType(selfMetatype);
SILValue val = F.begin()->createFunctionArgument(ty);
(void) val;
return;
}
emitCaptureArguments(*this, TheClosure, capture, ++ArgNo);
}
}