本文整理汇总了C++中IRGenFunction::emitTypeMetadataRefForLayout方法的典型用法代码示例。如果您正苦于以下问题:C++ IRGenFunction::emitTypeMetadataRefForLayout方法的具体用法?C++ IRGenFunction::emitTypeMetadataRefForLayout怎么用?C++ IRGenFunction::emitTypeMetadataRefForLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRGenFunction
的用法示例。
在下文中一共展示了IRGenFunction::emitTypeMetadataRefForLayout方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: emitDestroyCall
/// Emit a call to do a 'destroy' operation.
void irgen::emitDestroyCall(IRGenFunction &IGF,
SILType T,
llvm::Value *object) {
auto metadata = IGF.emitTypeMetadataRefForLayout(T);
llvm::Value *fn = IGF.emitValueWitnessForLayout(T,
ValueWitness::Destroy);
llvm::CallInst *call = IGF.Builder.CreateCall(fn, {object, metadata});
call->setCallingConv(IGF.IGM.RuntimeCC);
setHelperAttributes(call);
}
示例2: emitDestructiveProjectEnumDataCall
/// Emit a call to the 'destructiveProjectEnumData' operation.
/// The type must be dynamically known to have enum witnesses.
void irgen::emitDestructiveProjectEnumDataCall(IRGenFunction &IGF,
SILType T,
Address srcObject) {
auto metadata = IGF.emitTypeMetadataRefForLayout(T);
llvm::Value *fn = IGF.emitValueWitnessForLayout(T,
ValueWitness::DestructiveProjectEnumData);
llvm::CallInst *call =
IGF.Builder.CreateCall(fn, {srcObject.getAddress(), metadata});
call->setCallingConv(IGF.IGM.DefaultCC);
setHelperAttributes(call);
}
示例3: emitDeallocateBufferCall
void irgen::emitDeallocateBufferCall(IRGenFunction &IGF,
SILType T,
Address buffer) {
auto metadata = IGF.emitTypeMetadataRefForLayout(T);
llvm::Value *fn = IGF.emitValueWitnessForLayout(T,
ValueWitness::DeallocateBuffer);
llvm::CallInst *call =
IGF.Builder.CreateCall(fn, {buffer.getAddress(), metadata});
call->setCallingConv(IGF.IGM.DefaultCC);
setHelperAttributes(call);
}
示例4: emitDestroyArrayCall
/// Emit a call to do a 'destroyArray' operation.
void irgen::emitDestroyArrayCall(IRGenFunction &IGF,
SILType T,
Address object,
llvm::Value *count) {
auto metadata = IGF.emitTypeMetadataRefForLayout(T);
llvm::Value *fn = IGF.emitValueWitnessForLayout(T,
ValueWitness::DestroyArray);
llvm::CallInst *call =
IGF.Builder.CreateCall(fn, {object.getAddress(), count, metadata});
call->setCallingConv(IGF.IGM.DefaultCC);
setHelperAttributes(call);
}
示例5: emitAssignWithTakeCall
/// Emit a call to do an 'assignWithTake' operation.
void irgen::emitAssignWithTakeCall(IRGenFunction &IGF,
SILType T,
llvm::Value *destObject,
llvm::Value *srcObject) {
auto metadata = IGF.emitTypeMetadataRefForLayout(T);
llvm::Value *copyFn = IGF.emitValueWitnessForLayout(T,
ValueWitness::AssignWithTake);
llvm::CallInst *call =
IGF.Builder.CreateCall(copyFn, {destObject, srcObject, metadata});
call->setCallingConv(IGF.IGM.RuntimeCC);
call->setDoesNotThrow();
}
示例6: emitAssignWithCopyCall
void irgen::emitAssignWithCopyCall(IRGenFunction &IGF,
SILType T,
Address destObject,
Address srcObject) {
auto metadata = IGF.emitTypeMetadataRefForLayout(T);
llvm::Value *copyFn = IGF.emitValueWitnessForLayout(T,
ValueWitness::AssignWithCopy);
llvm::CallInst *call =
IGF.Builder.CreateCall(copyFn,
{destObject.getAddress(), srcObject.getAddress(), metadata});
call->setCallingConv(IGF.IGM.DefaultCC);
call->setDoesNotThrow();
}
示例7: emitDestructiveInjectEnumTagCall
/// Emit a call to the 'destructiveInjectEnumTag' operation.
/// The type must be dynamically known to have enum witnesses.
void irgen::emitDestructiveInjectEnumTagCall(IRGenFunction &IGF,
SILType T,
unsigned tag,
Address srcObject) {
auto metadata = IGF.emitTypeMetadataRefForLayout(T);
llvm::Value *fn = IGF.emitValueWitnessForLayout(T,
ValueWitness::DestructiveInjectEnumTag);
llvm::Value *tagValue =
llvm::ConstantInt::get(IGF.IGM.Int32Ty, tag);
llvm::CallInst *call =
IGF.Builder.CreateCall(fn, {srcObject.getAddress(), tagValue, metadata});
call->setCallingConv(IGF.IGM.DefaultCC);
setHelperAttributes(call);
}
示例8: emitInitializeArrayWithTakeBackToFrontCall
/// Emit a call to do an 'initializeArrayWithTakeBackToFront' operation.
void irgen::emitInitializeArrayWithTakeBackToFrontCall(IRGenFunction &IGF,
SILType T,
Address destObject,
Address srcObject,
llvm::Value *count) {
auto metadata = IGF.emitTypeMetadataRefForLayout(T);
llvm::Value *copyFn = IGF.emitValueWitnessForLayout(T,
ValueWitness::InitializeArrayWithTakeBackToFront);
llvm::CallInst *call =
IGF.Builder.CreateCall(copyFn,
{destObject.getAddress(), srcObject.getAddress(), count, metadata});
call->setCallingConv(IGF.IGM.DefaultCC);
call->setDoesNotThrow();
}