From b2e6068d4f2444cd8a60e86d17b81a18df05cb1a Mon Sep 17 00:00:00 2001 From: zoecarver Date: Thu, 23 Jul 2020 12:31:15 -0700 Subject: [PATCH] [cxx-interop] Rename ClangRecordTypeInfo -> LoadableClangRecordTypeInfo. This is a more accurate and clear name. This change will help further differenciate between LoadableClangRecordTypeInfo and (the soon to be added) AddressOnlyClangRecordTypeInfo. --- lib/IRGen/GenStruct.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/IRGen/GenStruct.cpp b/lib/IRGen/GenStruct.cpp index 1c5bd5eaf50c7..b8c647fbefc6d 100644 --- a/lib/IRGen/GenStruct.cpp +++ b/lib/IRGen/GenStruct.cpp @@ -52,7 +52,7 @@ using namespace irgen; enum class StructTypeInfoKind { LoadableStructTypeInfo, FixedStructTypeInfo, - ClangRecordTypeInfo, + LoadableClangRecordTypeInfo, NonFixedStructTypeInfo, ResilientStructTypeInfo }; @@ -292,17 +292,17 @@ namespace { }; /// A type implementation for loadable record types imported from Clang. - class ClangRecordTypeInfo final : - public StructTypeInfoBase { const clang::RecordDecl *ClangDecl; public: - ClangRecordTypeInfo(ArrayRef fields, + LoadableClangRecordTypeInfo(ArrayRef fields, unsigned explosionSize, llvm::Type *storageType, Size size, SpareBitVector &&spareBits, Alignment align, const clang::RecordDecl *clangDecl) - : StructTypeInfoBase(StructTypeInfoKind::ClangRecordTypeInfo, + : StructTypeInfoBase(StructTypeInfoKind::LoadableClangRecordTypeInfo, fields, explosionSize, storageType, size, std::move(spareBits), align, IsPOD, IsFixedSize), @@ -318,7 +318,7 @@ namespace { void initializeFromParams(IRGenFunction &IGF, Explosion ¶ms, Address addr, SILType T, bool isOutlined) const override { - ClangRecordTypeInfo::initialize(IGF, params, addr, isOutlined); + LoadableClangRecordTypeInfo::initialize(IGF, params, addr, isOutlined); } void addToAggLowering(IRGenModule &IGM, SwiftAggLowering &lowering, @@ -680,7 +680,7 @@ class ClangRecordLowering { const TypeInfo *createTypeInfo(llvm::StructType *llvmType) { llvmType->setBody(LLVMFields, /*packed*/ true); - return ClangRecordTypeInfo::create(FieldInfos, NextExplosionIndex, + return LoadableClangRecordTypeInfo::create(FieldInfos, NextExplosionIndex, llvmType, TotalStride, std::move(SpareBits), TotalAlignment, ClangDecl); @@ -865,8 +865,8 @@ class ClangRecordLowering { #define FOR_STRUCT_IMPL(IGF, type, op, ...) do { \ auto &structTI = IGF.getTypeInfo(type); \ switch (getStructTypeInfoKind(structTI)) { \ - case StructTypeInfoKind::ClangRecordTypeInfo: \ - return structTI.as().op(IGF, __VA_ARGS__); \ + case StructTypeInfoKind::LoadableClangRecordTypeInfo: \ + return structTI.as().op(IGF, __VA_ARGS__); \ case StructTypeInfoKind::LoadableStructTypeInfo: \ return structTI.as().op(IGF, __VA_ARGS__); \ case StructTypeInfoKind::FixedStructTypeInfo: \