mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
f884642f59
Old syntax:
```
unique_handle = "/model-type/1",
name = "my_struct",
size = 2,
fields = [
<
offset = 0
name = "",
type = !t
>,
<
offset = 1,
name = "my_field",
type = !t
>
]
>
unique_handle = "/model-type/1",
name = "my_union",
fields = [
<
offset = 0,
name = "",
type = !t
>,
<
offset = 0,
name = "my_field",
type = !t
>
]
>
```
New syntax:
```
"/model-type/1" as "my_struct" : size(1) {
offset(0) : !t,
offset(1) as "my_field" : !t
}
>
"/model-type/1" as "my_union" : {
!t,
"my_field" : !t
}
>
```
22 lines
492 B
MLIR
22 lines
492 B
MLIR
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
// RUN: %revngcliftopt %s
|
|
|
|
!int32_t = !clift.primitive<signed 4>
|
|
!int32_t$const = !clift.primitive<const signed 4>
|
|
|
|
!s = !clift.defined<#clift.struct<
|
|
"" : size(8) {
|
|
offset(0) as "x" : !int32_t,
|
|
offset(4) as "y" : !int32_t
|
|
}
|
|
>>
|
|
|
|
%0 = clift.undef : !int32_t
|
|
%a = clift.aggregate(%0, %0) : !s
|
|
|
|
%1 = clift.undef : !int32_t$const
|
|
%b = clift.aggregate(%1 : !int32_t$const, %1 : !int32_t$const) : !s
|