diff options
Diffstat (limited to 'hobgoblin/src/patio/values.hob')
| -rw-r--r-- | hobgoblin/src/patio/values.hob | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/hobgoblin/src/patio/values.hob b/hobgoblin/src/patio/values.hob new file mode 100644 index 00000000..0e14cf35 --- /dev/null +++ b/hobgoblin/src/patio/values.hob @@ -0,0 +1,43 @@ +import {PatioDataLayout} from ./types; + +// == Data ptr values == + +sum PatioDataPtrValue { + variant PatioDataPtrValueDataElement; + variant PatioDataPtrValueNull; +} + +struct PatioDataPtrValueDataElement { + field name: String; +} + +struct PatioDataPtrValueNull { +} + +// == Int values == + +/// An int value that is a constant in the compiled program, but may differ +/// across targets. +sum PatioIntValue { + variant PatioIntValueByteOffsetOf; + variant PatioIntValueByteSizeOf; + variant PatioIntValueLiteral; +} + +/// The offset, in bytes, of an offset in a data layout. +struct PatioIntValueByteOffsetOf { + field layout: PatioDataLayout; + field elementOffsets: List[Int32]; +} + +/// The size, in bytes, of a data layout. +struct PatioIntValueByteSizeOf { + field layout: PatioDataLayout; +} + +/// An int value that is the same across all targets. +struct PatioIntValueLiteral { + field value: Int32; +} + + |
