本文整理汇总了C++中IRGenFunction::setUnscopedLocalTypeData方法的典型用法代码示例。如果您正苦于以下问题:C++ IRGenFunction::setUnscopedLocalTypeData方法的具体用法?C++ IRGenFunction::setUnscopedLocalTypeData怎么用?C++ IRGenFunction::setUnscopedLocalTypeData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRGenFunction
的用法示例。
在下文中一共展示了IRGenFunction::setUnscopedLocalTypeData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setMetadataRef
static void setMetadataRef(IRGenFunction &IGF,
ArchetypeType *archetype,
llvm::Value *metadata) {
assert(metadata->getType() == IGF.IGM.TypeMetadataPtrTy);
IGF.setUnscopedLocalTypeData(CanType(archetype),
LocalTypeDataKind::forTypeMetadata(),
metadata);
}
示例2: setWitnessTable
static void setWitnessTable(IRGenFunction &IGF,
ArchetypeType *archetype,
unsigned protocolIndex,
llvm::Value *wtable) {
assert(wtable->getType() == IGF.IGM.WitnessTablePtrTy);
assert(protocolIndex < archetype->getConformsTo().size());
IGF.setUnscopedLocalTypeData(CanType(archetype),
LocalTypeData::forArchetypeProtocolWitness(protocolIndex), wtable);
}
示例3: bindMetadataParameters
void OutliningMetadataCollector::bindMetadataParameters(IRGenFunction &IGF,
Explosion ¶ms) const {
// Note that our parameter IGF intentionally shadows the IGF that this
// collector was built with.
for (auto &pair : Values) {
llvm::Value *arg = params.claimNext();
auto key = pair.first;
assert(key.Kind.isAnyTypeMetadata());
setTypeMetadataName(IGF.IGM, arg, key.Type);
IGF.setUnscopedLocalTypeData(key, MetadataResponse::forComplete(arg));
}
}
示例4: setMetadataRef
static void setMetadataRef(IRGenFunction &IGF,
ArchetypeType *archetype,
llvm::Value *metadata) {
assert(metadata->getType() == IGF.IGM.TypeMetadataPtrTy);
IGF.setUnscopedLocalTypeData(CanType(archetype),
LocalTypeData::forMetatype(),
metadata);
// Create a shadow copy of the metadata in an alloca for the debug info.
StringRef Name = metadata->getName();
if (!IGF.IGM.Opts.Optimize) {
auto Alloca = IGF.createAlloca(metadata->getType(),
IGF.IGM.getPointerAlignment(), Name);
IGF.Builder.CreateAlignedStore(metadata, Alloca.getAddress(),
IGF.IGM.getPointerAlignment().getValue());
metadata = Alloca.getAddress();
}
// Emit debug info for the metadata.
if (IGF.IGM.DebugInfo)
IGF.IGM.DebugInfo->emitTypeMetadata(IGF, metadata, Name);
}