1
- // ===--- GenSequential .h - IR generation for sequential types ---*- C++ -*-===//
1
+ // ===--- GenRecord .h - IR generation for record types -------- ---*- C++ -*-===//
2
2
//
3
3
// This source file is part of the Swift.org open source project
4
4
//
10
10
//
11
11
// ===----------------------------------------------------------------------===//
12
12
//
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.
15
15
//
16
16
// ===----------------------------------------------------------------------===//
17
17
18
- #ifndef SWIFT_IRGEN_GENSEQUENTIAL_H
19
- #define SWIFT_IRGEN_GENSEQUENTIAL_H
18
+ #ifndef SWIFT_IRGEN_GENRECORD_H
19
+ #define SWIFT_IRGEN_GENRECORD_H
20
20
21
21
#include " IRGenFunction.h"
22
22
#include " IRGenModule.h"
29
29
namespace swift {
30
30
namespace irgen {
31
31
32
- template <class , class , class > class SequentialTypeBuilder ;
32
+ template <class , class , class > class RecordTypeBuilder ;
33
33
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 {
36
36
ElementLayout Layout;
37
37
38
- template <class , class , class > friend class SequentialTypeBuilder ;
38
+ template <class , class , class > friend class RecordTypeBuilder ;
39
39
40
40
// / Begin/End - the range of explosion indexes for this element
41
41
unsigned Begin : 16 ;
42
42
unsigned End : 16 ;
43
43
44
44
protected:
45
- explicit SequentialField (const TypeInfo &elementTI)
45
+ explicit RecordField (const TypeInfo &elementTI)
46
46
: Layout(ElementLayout::getIncomplete(elementTI)) {}
47
47
48
- explicit SequentialField (const ElementLayout &layout,
49
- unsigned begin, unsigned end)
48
+ explicit RecordField (const ElementLayout &layout,
49
+ unsigned begin, unsigned end)
50
50
: Layout(layout), Begin(begin), End(end) {}
51
51
52
52
const FieldImpl *asImpl () const {
@@ -85,10 +85,10 @@ template <class FieldImpl> class SequentialField {
85
85
}
86
86
};
87
87
88
- // / A metaprogrammed TypeInfo implementation for sequential types.
88
+ // / A metaprogrammed TypeInfo implementation for record types.
89
89
template <class Impl , class Base , class FieldImpl_ ,
90
90
bool IsLoadable = std::is_base_of<LoadableTypeInfo, Base>::value>
91
- class SequentialTypeInfoImpl : public Base {
91
+ class RecordTypeInfoImpl : public Base {
92
92
public:
93
93
typedef FieldImpl_ FieldImpl;
94
94
@@ -106,7 +106,7 @@ class SequentialTypeInfoImpl : public Base {
106
106
const Impl &asImpl () const { return *static_cast <const Impl*>(this ); }
107
107
108
108
template <class ... As>
109
- SequentialTypeInfoImpl (ArrayRef<FieldImpl> fields, As&&...args)
109
+ RecordTypeInfoImpl (ArrayRef<FieldImpl> fields, As&&...args)
110
110
: Base(std::forward<As>(args)...), NumFields(fields.size()) {
111
111
std::uninitialized_copy (fields.begin (), fields.end (),
112
112
getFieldsBuffer ());
@@ -214,32 +214,32 @@ class SequentialTypeInfoImpl : public Base {
214
214
215
215
template <class Impl , class Base , class FieldImpl_ ,
216
216
bool IsLoadable = std::is_base_of<LoadableTypeInfo, Base>::value>
217
- class SequentialTypeInfo ;
217
+ class RecordTypeInfo ;
218
218
219
- // / An implementation of SequentialTypeInfo for non-loadable types.
219
+ // / An implementation of RecordTypeInfo for non-loadable types.
220
220
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;
224
224
protected:
225
225
template <class ... As>
226
- SequentialTypeInfo (As&&...args) : super(std::forward<As>(args)...) {}
226
+ RecordTypeInfo (As&&...args) : super(std::forward<As>(args)...) {}
227
227
};
228
228
229
- // / An implementation of SequentialTypeInfo for loadable types.
229
+ // / An implementation of RecordTypeInfo for loadable types.
230
230
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;
234
234
235
235
unsigned ExplosionSize : 16 ;
236
236
237
237
protected:
238
238
using super::asImpl;
239
239
240
240
template <class ... As>
241
- SequentialTypeInfo (ArrayRef<FieldImpl> fields, unsigned explosionSize,
242
- As &&...args)
241
+ RecordTypeInfo (ArrayRef<FieldImpl> fields, unsigned explosionSize,
242
+ As &&...args)
243
243
: super(fields, std::forward<As>(args)...),
244
244
ExplosionSize (explosionSize) {}
245
245
@@ -346,7 +346,7 @@ class SequentialTypeInfo<Impl, Base, FieldImpl, /*IsLoadable*/ true>
346
346
}
347
347
};
348
348
349
- // / A builder of sequential types.
349
+ // / A builder of record types.
350
350
// /
351
351
// / Required for a full implementation:
352
352
// / TypeInfoImpl *construct(void *buffer, ArrayRef<ASTField> fields);
@@ -355,10 +355,10 @@ class SequentialTypeInfo<Impl, Base, FieldImpl, /*IsLoadable*/ true>
355
355
// / void performLayout(ArrayRef<const TypeInfo *> fieldTypes);
356
356
// / - should call recordLayout with the layout
357
357
template <class BuilderImpl , class FieldImpl , class ASTField >
358
- class SequentialTypeBuilder {
358
+ class RecordTypeBuilder {
359
359
protected:
360
360
IRGenModule &IGM;
361
- SequentialTypeBuilder (IRGenModule &IGM) : IGM(IGM) {}
361
+ RecordTypeBuilder (IRGenModule &IGM) : IGM(IGM) {}
362
362
363
363
BuilderImpl *asImpl () { return static_cast <BuilderImpl*>(this ); }
364
364
0 commit comments