Support variadic fields in Records #446

Merged
3 commits merged into from Nov 19, 2012

Projects

None yet

1 participant

@ghost
ghost commented Nov 19, 2012

No description provided.

agemogolk added some commits Nov 19, 2012
agemogolk Allow optional variadic record fields.
Update record primitives for accessing variadic records.
Update record lib to support variadic records (INCOMPLETE)
Update referenceType lib to support variadic records (INCOMPLETE)
268e845
agemogolk Add recordVariadicField prim-op.
Add variadic record field test.
Update record primitives to support var fields.
Update debug info for var record fields.
94756a6
@jckarter jckarter commented on an outdated diff Nov 19, 2012
compiler/clay.hpp
@@ -2828,6 +2835,9 @@ struct RecordType : public Type {
vector<IdentifierPtr> fieldNames;
vector<TypePtr> fieldTypes;
+ unsigned varFieldPosition;
+ bool hasVarField:1;
@jckarter
jckarter Nov 19, 2012 owner

To minimize size, I sorted all the class fields by descending alignment order, so to keep that going, these two fields should probably go to the end of the object.

@jckarter
Owner

Looks good. You could potentially also support multiple variadic fields, although you wouldn't be able to use the default constructor with them.

@ghost ghost merged commit fb63da9 into jckarter:master Nov 19, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment