Commit e5e34217 authored by Kenton Varda's avatar Kenton Varda

Remove no-longer-needed index field from schema.capnp.

parent 252b516e
...@@ -198,11 +198,6 @@ struct StructNode { ...@@ -198,11 +198,6 @@ struct StructNode {
ordinal @1 :UInt16; ordinal @1 :UInt16;
index @7 :UInt16;
# The index of this member within the containing struct or union's member list. This is
# redundant information, but it can be useful for the dynamic API which has methods that take
# a Member pointer to specify on which member to act.
codeOrder @2 :UInt16; codeOrder @2 :UInt16;
# Indicates where this member appeared in the code, relative to other members. # Indicates where this member appeared in the code, relative to other members.
# Code ordering may have semantic relevance -- programmers tend to place related fields # Code ordering may have semantic relevance -- programmers tend to place related fields
......
...@@ -591,7 +591,7 @@ encodeSchema requestedFiles allFiles = (encRoot, nodesForEmbedding) where ...@@ -591,7 +591,7 @@ encodeSchema requestedFiles allFiles = (encRoot, nodesForEmbedding) where
, (16, encUInt16 $ structPointerCount desc) , (16, encUInt16 $ structPointerCount desc)
, (32, encUInt16 (fieldSizeEnum preferredListEncoding::Word16)) , (32, encUInt16 (fieldSizeEnum preferredListEncoding::Word16))
] ]
ptrValues = [ (0, encStructList memberSize $ zipWith encMember [0::Word16 ..] $ ptrValues = [ (0, encStructList memberSize $ map encMember $
sortMembers $ structMembers desc) ] sortMembers $ structMembers desc) ]
preferredListEncoding = case (structDataSize desc, structPointerCount desc) of preferredListEncoding = case (structDataSize desc, structPointerCount desc) of
...@@ -613,11 +613,10 @@ encodeSchema requestedFiles allFiles = (encRoot, nodesForEmbedding) where ...@@ -613,11 +613,10 @@ encodeSchema requestedFiles allFiles = (encRoot, nodesForEmbedding) where
selectFieldOrUnion _ = Nothing selectFieldOrUnion _ = Nothing
memberSize = (DataSectionWords 1, 3) memberSize = (DataSectionWords 1, 3)
encMember index (codeOrder, (_, DescField field)) = (dataValues2, ptrValues2) where encMember (codeOrder, (_, DescField field)) = (dataValues2, ptrValues2) where
dataValues2 = [ (0, encUInt16 $ fieldNumber field) dataValues2 = [ (0, encUInt16 $ fieldNumber field)
, (16, encUInt16 codeOrder) , (16, encUInt16 codeOrder)
, (32, encUInt16 (0::Word16)) -- discriminant , (32, encUInt16 (0::Word16)) -- discriminant
, (48, encUInt16 index)
] ]
ptrValues2 = [ (0, encText $ fieldName field) ptrValues2 = [ (0, encText $ fieldName field)
, (1, encAnnotationList $ fieldAnnotations field) , (1, encAnnotationList $ fieldAnnotations field)
...@@ -637,11 +636,10 @@ encodeSchema requestedFiles allFiles = (encRoot, nodesForEmbedding) where ...@@ -637,11 +636,10 @@ encodeSchema requestedFiles allFiles = (encRoot, nodesForEmbedding) where
offsetToInt (InlineCompositeOffset {}) = offsetToInt (InlineCompositeOffset {}) =
error "Inline types not currently supported by codegen plugins." error "Inline types not currently supported by codegen plugins."
encMember index (codeOrder, (_, DescUnion union)) = (dataValues2, ptrValues2) where encMember (codeOrder, (_, DescUnion union)) = (dataValues2, ptrValues2) where
dataValues2 = [ (0, encUInt16 $ unionNumber union) dataValues2 = [ (0, encUInt16 $ unionNumber union)
, (16, encUInt16 codeOrder) , (16, encUInt16 codeOrder)
, (32, encUInt16 (1::Word16)) -- discriminant , (32, encUInt16 (1::Word16)) -- discriminant
, (48, encUInt16 index)
] ]
ptrValues2 = [ (0, encText $ unionName union) ptrValues2 = [ (0, encText $ unionName union)
, (1, encAnnotationList $ unionAnnotations union) , (1, encAnnotationList $ unionAnnotations union)
...@@ -650,9 +648,9 @@ encodeSchema requestedFiles allFiles = (encRoot, nodesForEmbedding) where ...@@ -650,9 +648,9 @@ encodeSchema requestedFiles allFiles = (encRoot, nodesForEmbedding) where
-- StructNode.Union -- StructNode.Union
dataValues3 = [ (0, encUInt32 $ unionTagOffset union) ] dataValues3 = [ (0, encUInt32 $ unionTagOffset union) ]
ptrValues3 = [ (0, encStructList memberSize $ zipWith encMember [0..] $ sortMembers $ ptrValues3 = [ (0, encStructList memberSize $ map encMember $ sortMembers $
unionMembers union) ] unionMembers union) ]
encMember _ _ = error "Not a field or union?" encMember _ = error "Not a field or union?"
enumNodeSize = (DataSectionWords 0, 1) enumNodeSize = (DataSectionWords 0, 1)
encEnumNode desc = (dataValues, ptrValues) where encEnumNode desc = (dataValues, ptrValues) where
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment