Skip to content

Commit 1302539

Browse files
committed
IRGen: Rename "Sequential Type" to "Record Type", the latter is more standard, NFC.
1 parent c45dc6d commit 1302539

File tree

3 files changed

+47
-47
lines changed

3 files changed

+47
-47
lines changed

lib/IRGen/GenSequential.h renamed to lib/IRGen/GenRecord.h

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- GenSequential.h - IR generation for sequential types ---*- C++ -*-===//
1+
//===--- GenRecord.h - IR generation for record types -----------*- C++ -*-===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
@@ -10,13 +10,13 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212
//
13-
// This file provides some common code for emitting sequential types.
14-
// A sequential type is something like a tuple or a struct.
13+
// This file provides some common code for emitting record types.
14+
// A record type is something like a tuple or a struct.
1515
//
1616
//===----------------------------------------------------------------------===//
1717

18-
#ifndef SWIFT_IRGEN_GENSEQUENTIAL_H
19-
#define SWIFT_IRGEN_GENSEQUENTIAL_H
18+
#ifndef SWIFT_IRGEN_GENRECORD_H
19+
#define SWIFT_IRGEN_GENRECORD_H
2020

2121
#include "IRGenFunction.h"
2222
#include "IRGenModule.h"
@@ -29,24 +29,24 @@
2929
namespace swift {
3030
namespace irgen {
3131

32-
template <class, class, class> class SequentialTypeBuilder;
32+
template <class, class, class> class RecordTypeBuilder;
3333

34-
/// A field of a sequential type.
35-
template <class FieldImpl> class SequentialField {
34+
/// A field of a record type.
35+
template <class FieldImpl> class RecordField {
3636
ElementLayout Layout;
3737

38-
template <class, class, class> friend class SequentialTypeBuilder;
38+
template <class, class, class> friend class RecordTypeBuilder;
3939

4040
/// Begin/End - the range of explosion indexes for this element
4141
unsigned Begin : 16;
4242
unsigned End : 16;
4343

4444
protected:
45-
explicit SequentialField(const TypeInfo &elementTI)
45+
explicit RecordField(const TypeInfo &elementTI)
4646
: Layout(ElementLayout::getIncomplete(elementTI)) {}
4747

48-
explicit SequentialField(const ElementLayout &layout,
49-
unsigned begin, unsigned end)
48+
explicit RecordField(const ElementLayout &layout,
49+
unsigned begin, unsigned end)
5050
: Layout(layout), Begin(begin), End(end) {}
5151

5252
const FieldImpl *asImpl() const {
@@ -85,10 +85,10 @@ template <class FieldImpl> class SequentialField {
8585
}
8686
};
8787

88-
/// A metaprogrammed TypeInfo implementation for sequential types.
88+
/// A metaprogrammed TypeInfo implementation for record types.
8989
template <class Impl, class Base, class FieldImpl_,
9090
bool IsLoadable = std::is_base_of<LoadableTypeInfo, Base>::value>
91-
class SequentialTypeInfoImpl : public Base {
91+
class RecordTypeInfoImpl : public Base {
9292
public:
9393
typedef FieldImpl_ FieldImpl;
9494

@@ -106,7 +106,7 @@ class SequentialTypeInfoImpl : public Base {
106106
const Impl &asImpl() const { return *static_cast<const Impl*>(this); }
107107

108108
template <class... As>
109-
SequentialTypeInfoImpl(ArrayRef<FieldImpl> fields, As&&...args)
109+
RecordTypeInfoImpl(ArrayRef<FieldImpl> fields, As&&...args)
110110
: Base(std::forward<As>(args)...), NumFields(fields.size()) {
111111
std::uninitialized_copy(fields.begin(), fields.end(),
112112
getFieldsBuffer());
@@ -214,32 +214,32 @@ class SequentialTypeInfoImpl : public Base {
214214

215215
template <class Impl, class Base, class FieldImpl_,
216216
bool IsLoadable = std::is_base_of<LoadableTypeInfo, Base>::value>
217-
class SequentialTypeInfo;
217+
class RecordTypeInfo;
218218

219-
/// An implementation of SequentialTypeInfo for non-loadable types.
219+
/// An implementation of RecordTypeInfo for non-loadable types.
220220
template <class Impl, class Base, class FieldImpl>
221-
class SequentialTypeInfo<Impl, Base, FieldImpl, /*IsLoadable*/ false>
222-
: public SequentialTypeInfoImpl<Impl, Base, FieldImpl> {
223-
typedef SequentialTypeInfoImpl<Impl, Base, FieldImpl> super;
221+
class RecordTypeInfo<Impl, Base, FieldImpl, /*IsLoadable*/ false>
222+
: public RecordTypeInfoImpl<Impl, Base, FieldImpl> {
223+
typedef RecordTypeInfoImpl<Impl, Base, FieldImpl> super;
224224
protected:
225225
template <class... As>
226-
SequentialTypeInfo(As&&...args) : super(std::forward<As>(args)...) {}
226+
RecordTypeInfo(As&&...args) : super(std::forward<As>(args)...) {}
227227
};
228228

229-
/// An implementation of SequentialTypeInfo for loadable types.
229+
/// An implementation of RecordTypeInfo for loadable types.
230230
template <class Impl, class Base, class FieldImpl>
231-
class SequentialTypeInfo<Impl, Base, FieldImpl, /*IsLoadable*/ true>
232-
: public SequentialTypeInfoImpl<Impl, Base, FieldImpl> {
233-
typedef SequentialTypeInfoImpl<Impl, Base, FieldImpl> super;
231+
class RecordTypeInfo<Impl, Base, FieldImpl, /*IsLoadable*/ true>
232+
: public RecordTypeInfoImpl<Impl, Base, FieldImpl> {
233+
typedef RecordTypeInfoImpl<Impl, Base, FieldImpl> super;
234234

235235
unsigned ExplosionSize : 16;
236236

237237
protected:
238238
using super::asImpl;
239239

240240
template <class... As>
241-
SequentialTypeInfo(ArrayRef<FieldImpl> fields, unsigned explosionSize,
242-
As &&...args)
241+
RecordTypeInfo(ArrayRef<FieldImpl> fields, unsigned explosionSize,
242+
As &&...args)
243243
: super(fields, std::forward<As>(args)...),
244244
ExplosionSize(explosionSize) {}
245245

@@ -346,7 +346,7 @@ class SequentialTypeInfo<Impl, Base, FieldImpl, /*IsLoadable*/ true>
346346
}
347347
};
348348

349-
/// A builder of sequential types.
349+
/// A builder of record types.
350350
///
351351
/// Required for a full implementation:
352352
/// TypeInfoImpl *construct(void *buffer, ArrayRef<ASTField> fields);
@@ -355,10 +355,10 @@ class SequentialTypeInfo<Impl, Base, FieldImpl, /*IsLoadable*/ true>
355355
/// void performLayout(ArrayRef<const TypeInfo *> fieldTypes);
356356
/// - should call recordLayout with the layout
357357
template <class BuilderImpl, class FieldImpl, class ASTField>
358-
class SequentialTypeBuilder {
358+
class RecordTypeBuilder {
359359
protected:
360360
IRGenModule &IGM;
361-
SequentialTypeBuilder(IRGenModule &IGM) : IGM(IGM) {}
361+
RecordTypeBuilder(IRGenModule &IGM) : IGM(IGM) {}
362362

363363
BuilderImpl *asImpl() { return static_cast<BuilderImpl*>(this); }
364364

lib/IRGen/GenStruct.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "clang/AST/RecordLayout.h"
2929

3030
#include "GenMeta.h"
31-
#include "GenSequential.h"
31+
#include "GenRecord.h"
3232
#include "GenType.h"
3333
#include "IRGenFunction.h"
3434
#include "IRGenModule.h"
@@ -57,10 +57,10 @@ static StructTypeInfoKind getStructTypeInfoKind(const TypeInfo &type) {
5757
}
5858

5959
namespace {
60-
class StructFieldInfo : public SequentialField<StructFieldInfo> {
60+
class StructFieldInfo : public RecordField<StructFieldInfo> {
6161
public:
6262
StructFieldInfo(VarDecl *field, const TypeInfo &type)
63-
: SequentialField(type), Field(field) {}
63+
: RecordField(type), Field(field) {}
6464

6565
/// The field.
6666
VarDecl * const Field;
@@ -75,11 +75,11 @@ namespace {
7575
};
7676

7777
/// A field-info implementation for fields of Clang types.
78-
class ClangFieldInfo : public SequentialField<ClangFieldInfo> {
78+
class ClangFieldInfo : public RecordField<ClangFieldInfo> {
7979
public:
8080
ClangFieldInfo(VarDecl *swiftField, const ElementLayout &layout,
8181
unsigned explosionBegin, unsigned explosionEnd)
82-
: SequentialField(layout, explosionBegin, explosionEnd),
82+
: RecordField(layout, explosionBegin, explosionEnd),
8383
Field(swiftField) {}
8484

8585
VarDecl * const Field;
@@ -102,8 +102,8 @@ namespace {
102102
/// A common base class for structs.
103103
template <class Impl, class Base, class FieldInfoType = StructFieldInfo>
104104
class StructTypeInfoBase :
105-
public SequentialTypeInfo<Impl, Base, FieldInfoType> {
106-
typedef SequentialTypeInfo<Impl, Base, FieldInfoType> super;
105+
public RecordTypeInfo<Impl, Base, FieldInfoType> {
106+
typedef RecordTypeInfo<Impl, Base, FieldInfoType> super;
107107

108108
protected:
109109
template <class... As>
@@ -441,14 +441,14 @@ namespace {
441441
};
442442

443443
class StructTypeBuilder :
444-
public SequentialTypeBuilder<StructTypeBuilder, StructFieldInfo, VarDecl*> {
444+
public RecordTypeBuilder<StructTypeBuilder, StructFieldInfo, VarDecl*> {
445445

446446
llvm::StructType *StructTy;
447447
CanType TheStruct;
448448
public:
449449
StructTypeBuilder(IRGenModule &IGM, llvm::StructType *structTy,
450450
CanType type) :
451-
SequentialTypeBuilder(IGM), StructTy(structTy), TheStruct(type) {
451+
RecordTypeBuilder(IGM), StructTy(structTy), TheStruct(type) {
452452
}
453453

454454
LoadableStructTypeInfo *createLoadable(ArrayRef<StructFieldInfo> fields,

lib/IRGen/GenTuple.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "llvm/IR/DerivedTypes.h"
2828

2929
#include "GenHeap.h"
30-
#include "GenSequential.h"
30+
#include "GenRecord.h"
3131
#include "GenType.h"
3232
#include "IRGenFunction.h"
3333
#include "IRGenModule.h"
@@ -43,10 +43,10 @@ using namespace swift;
4343
using namespace irgen;
4444

4545
namespace {
46-
class TupleFieldInfo : public SequentialField<TupleFieldInfo> {
46+
class TupleFieldInfo : public RecordField<TupleFieldInfo> {
4747
public:
4848
TupleFieldInfo(unsigned index, StringRef name, const TypeInfo &type)
49-
: SequentialField(type), Index(index), Name(name)
49+
: RecordField(type), Index(index), Name(name)
5050
{}
5151

5252
/// The field index.
@@ -71,8 +71,8 @@ namespace {
7171
/// Adapter for tuple types.
7272
template <class Impl, class Base>
7373
class TupleTypeInfoBase
74-
: public SequentialTypeInfo<Impl, Base, TupleFieldInfo> {
75-
typedef SequentialTypeInfo<Impl, Base, TupleFieldInfo> super;
74+
: public RecordTypeInfo<Impl, Base, TupleFieldInfo> {
75+
typedef RecordTypeInfo<Impl, Base, TupleFieldInfo> super;
7676

7777
protected:
7878
template <class... As>
@@ -283,13 +283,13 @@ namespace {
283283
};
284284

285285
class TupleTypeBuilder :
286-
public SequentialTypeBuilder<TupleTypeBuilder, TupleFieldInfo,
287-
TupleTypeElt> {
286+
public RecordTypeBuilder<TupleTypeBuilder, TupleFieldInfo,
287+
TupleTypeElt> {
288288
SILType TheTuple;
289289

290290
public:
291291
TupleTypeBuilder(IRGenModule &IGM, SILType theTuple)
292-
: SequentialTypeBuilder(IGM), TheTuple(theTuple) {}
292+
: RecordTypeBuilder(IGM), TheTuple(theTuple) {}
293293

294294
FixedTupleTypeInfo *createFixed(ArrayRef<TupleFieldInfo> fields,
295295
StructLayout &&layout) {

0 commit comments

Comments
 (0)