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//
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"
2929namespace swift {
3030namespace 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
4444protected:
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.
8989template <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 {
9292public:
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
215215template <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.
220220template <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;
224224protected:
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.
230230template <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
237237protected:
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
357357template <class BuilderImpl , class FieldImpl , class ASTField >
358- class SequentialTypeBuilder {
358+ class RecordTypeBuilder {
359359protected:
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
0 commit comments