本文整理汇总了C++中IRGenModule::getPointerAlignment方法的典型用法代码示例。如果您正苦于以下问题:C++ IRGenModule::getPointerAlignment方法的具体用法?C++ IRGenModule::getPointerAlignment怎么用?C++ IRGenModule::getPointerAlignment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRGenModule
的用法示例。
在下文中一共展示了IRGenModule::getPointerAlignment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addHeapHeaderToLayout
/// Add the fields for the standard heap header to the given layout.
void irgen::addHeapHeaderToLayout(IRGenModule &IGM,
Size &size, Alignment &align,
SmallVectorImpl<llvm::Type*> &fields) {
assert(size.isZero() && align.isOne() && fields.empty());
size = getHeapHeaderSize(IGM);
align = IGM.getPointerAlignment();
fields.push_back(IGM.RefCountedStructTy);
}
示例2: getAlignment
Alignment LinkEntity::getAlignment(IRGenModule &IGM) const {
switch (getKind()) {
case Kind::ModuleDescriptor:
case Kind::ExtensionDescriptor:
case Kind::AnonymousDescriptor:
case Kind::NominalTypeDescriptor:
case Kind::ProtocolDescriptor:
case Kind::AssociatedTypeDescriptor:
case Kind::AssociatedConformanceDescriptor:
case Kind::BaseConformanceDescriptor:
case Kind::ProtocolConformanceDescriptor:
case Kind::ProtocolRequirementsBaseDescriptor:
case Kind::ReflectionBuiltinDescriptor:
case Kind::ReflectionFieldDescriptor:
case Kind::ReflectionAssociatedTypeDescriptor:
case Kind::PropertyDescriptor:
case Kind::EnumCase:
case Kind::MethodDescriptor:
case Kind::MethodDescriptorInitializer:
case Kind::MethodDescriptorAllocator:
case Kind::OpaqueTypeDescriptor:
return Alignment(4);
case Kind::ObjCClassRef:
case Kind::ObjCClass:
case Kind::TypeMetadataLazyCacheVariable:
case Kind::TypeMetadataSingletonInitializationCache:
case Kind::TypeMetadata:
case Kind::TypeMetadataPattern:
case Kind::ClassMetadataBaseOffset:
case Kind::TypeMetadataInstantiationCache:
case Kind::ValueWitnessTable:
case Kind::FieldOffset:
case Kind::ProtocolWitnessTableLazyCacheVariable:
case Kind::ProtocolWitnessTable:
case Kind::ProtocolWitnessTablePattern:
case Kind::ObjCMetaclass:
case Kind::SwiftMetaclassStub:
case Kind::DynamicallyReplaceableFunctionVariable:
case Kind::DynamicallyReplaceableFunctionKey:
case Kind::OpaqueTypeDescriptorAccessorKey:
case Kind::OpaqueTypeDescriptorAccessorVar:
case Kind::ObjCResilientClassStub:
return IGM.getPointerAlignment();
case Kind::SILFunction:
return Alignment(1);
default:
llvm_unreachable("alignment not specified");
}
}
示例3: getFixedBufferAlignment
Alignment irgen::getFixedBufferAlignment(IRGenModule &IGM) {
return IGM.getPointerAlignment();
}