Commit Graph

38 Commits

Author SHA1 Message Date
Lauri Vasama d6a2ee387e Add aliases for Clift types without handles 2025-03-24 09:26:43 +02:00
Lauri Vasama e9c329e51d Rename Clift unique handle to handle 2025-03-24 09:26:43 +02:00
Lauri Vasama ea78766f10 Overhaul clift.enum assembly syntax
Old syntax:
```
	unique_handle = "/model-type/1",
	name = "my_enum",
	underlying_type = !t,
	fields = [
		<
			name = "my_enumerator",
			raw_value = 42
		>
	]
>
```

New syntax:
```
	"/model-type/1" as "my_enum" : !t {
		42 as "my_enumerator"
	}
>
```
2025-03-24 09:26:43 +02:00
Lauri Vasama 08c2c0a477 Remove ScalarTupleType
After converting type IDs to unique handles it was decided to remove
scalar tuple types in favour of generated structs with non-model unique
handles.
2025-03-19 12:57:18 +02:00
Lauri Vasama 386efffb2f Convert TypeDefinitionAttr ID to UniqueHandle 2025-03-19 12:57:17 +02:00
Alessandro Di Federico 143c315196 Merge revng-c into revng 2024-11-21 10:50:55 +01:00
Lauri Vasama ecf4869473 Move CliftTypeHelpers.h functions to CliftType.h
Also added some new type functions.
2024-10-31 08:41:25 +01:00
Lauri Vasama 7a0db383c5 A void-returning Clift function has a result 2024-10-31 08:41:25 +01:00
Lauri Vasama c821fd0455 Remove Clift FunctionArgumentAttr
The FunctionArgumentAttr was removed in order to better conform to the
builtin FunctionOpInterface. The FunctionOpInterface exposes the
argument and result types as array attributes of mlir::Type, and this
was difficult when each argument was wrapped in a FunctionArgumentAttr.

Debug names of the function types arguments from the model is currently
lost in the conversion to MLIR, but when the conversion for functions
themselves is implemented, the names can be added to the function
operations as argument attributes.
2024-09-04 10:58:02 +02:00
Pietro Fezzardi 9d24e9372d Clift FieldAttr::verify: improve debug message 2024-06-18 11:17:41 +02:00
Lauri Vasama 6803317f56 Remove type completeness check in FieldAttr verify 2024-06-13 14:03:28 +03:00
Lauri Vasama cccee1ed99 Add structured Clift type alias generation 2024-06-05 15:07:23 +02:00
Lauri Vasama bfe353d1f6 Improve Clift type and type attribute verification 2024-06-05 15:07:23 +02:00
Lauri Vasama d822e463e2 Use clift::ValueType instead of mlir::Type 2024-06-05 15:07:23 +02:00
Lauri Vasama 6470dd34ff Miscellaneous Clift cleanup for consistency 2024-06-05 15:07:23 +02:00
Lauri Vasama 9f7cfa183f Reorganize Clift code 2024-06-05 15:07:23 +02:00
Lauri Vasama 34d488a086 Add using directives for mlir::clift 2024-06-05 15:07:23 +02:00
Lauri Vasama 4ebe4fb140 Rename remaining Clift type definition attributes 2024-06-05 15:07:23 +02:00
Lauri Vasama a310080fbd Rename Clift StructType and UnionType attributes 2024-06-05 15:07:23 +02:00
Lauri Vasama 8f19b5f351 Remove redundant global namespace qualifiers 2024-06-05 15:07:23 +02:00
Lauri Vasama f4ff27b221 Add ScalarTupleType for RawFunctionType return 2024-05-29 15:43:35 +02:00
Lauri Vasama 9f99866edd Move CliftStorage.h to lib/ 2024-05-29 15:43:35 +02:00
Lauri Vasama 6db424b02b Factor Clift type parsing out into separate files 2024-05-29 15:43:35 +02:00
Lauri Vasama 10a80de57f Fix Clift type parsing
* Allow empty parameter list for FunctionAttr.
* Allow empty field list for struct but not union.
2024-05-29 15:43:35 +02:00
Lauri Vasama 84f7926c9c Naming and reorganization for consistency 2024-05-29 15:43:35 +02:00
Lauri Vasama 1059c51292 Refactor StructTypeStorage and UnionTypeStorage 2024-05-29 15:43:35 +02:00
Lauri Vasama b5b79709be Fix spelling of OnUnexpectedToken 2024-05-29 15:43:35 +02:00
Lauri Vasama dbdb4aabcb Add alias for error emission function_ref 2024-05-29 15:43:35 +02:00
Lauri Vasama 38c0605e76 Fix error message in StructType::parse 2024-05-29 15:43:35 +02:00
Lauri Vasama c24f40ad43 Add missing verify functions 2024-05-29 15:43:35 +02:00
Lauri Vasama 73187864ee Fix UnionType::verify
* Add field type completeness check.
* Remove field name uniqueness check.
2024-05-29 15:43:35 +02:00
Lauri Vasama 5341c2bb0a Fix StructType::verify
* Simplify offset and size checks.
* Add field type completeness check.
* Remove field name uniqueness check.
2024-05-29 15:43:35 +02:00
Lauri Vasama 3a547889a3 Move struct,union get,getChecked defs to .cpp
There seem to be some issues with defining these in headers due to the
storage type being incomplete. The storage type is only defined in the
.cpp file.
2024-05-29 15:43:35 +02:00
Lauri Vasama e9cacbc613 Replace unsigned long with uint64_t 2024-05-29 15:43:35 +02:00
Lauri Vasama 9730b00e88 Remove UnionType::verify size parameter 2024-05-29 15:43:35 +02:00
Alessandro Di Federico 0c212b66d9 Relicense to MIT 2024-02-29 17:03:36 +01:00
Massimo Fioravanti ab856523dd Introduce clift types 2024-02-04 16:49:51 +01:00
Andrea Gussoni ac6139bc0f clift: import mlir::clift dialect 2023-07-07 17:48:13 +02:00