Commit Graph

76 Commits

Author SHA1 Message Date
Alessandro Di Federico 143c315196 Merge revng-c into revng 2024-11-21 10:50:55 +01:00
Ivan Krysak 64446d0453 Adopt name builder across the model users 2024-11-06 19:18:53 +02:00
Lauri Vasama 2d2fe890fb Add Clift expression operations 2024-10-31 08:41:25 +01:00
Lauri Vasama 4338607257 Add Clift operand type parser 2024-10-31 08:41:25 +01:00
Lauri Vasama eb20e745a3 Add Clift op type constraints 2024-10-31 08:41:25 +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 26adce6182 Add isLvalueExpression on ExpressionOpInterface 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 e1b55fd5c3 Add custom assembly format for Clift FunctionOp 2024-10-31 08:41:25 +01:00
Lauri Vasama 8e6adb5268 Add addConst and removeConst for ValueType 2024-10-31 08:41:25 +01:00
Lauri Vasama 8a613dc9f0 Remove Clift ArrayType const
Use the qualification of the element type instead.
2024-10-31 08:41:25 +01:00
Lauri Vasama b8f0e7d99b Add missing const qualifiers in DefinedType 2024-10-31 08:41:25 +01:00
Lauri Vasama 6062d4a863 Fix YieldOp::verify message 2024-10-31 08:41:25 +01:00
Alessandro Di Federico 045f982a32 Improve usage of Expected<T> 2024-10-09 15:16:55 +02:00
Alessandro Di Federico 8706fd8459 Initialize pointers to nullptr 2024-09-27 10:35:10 +02:00
Alessandro Di Federico ca99bbbb66 Adopt toString() 2024-09-26 17:51:08 +02: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
Lauri Vasama 10d878e5ac Add verification of control statement nesting 2024-09-04 10:58:02 +02:00
Lauri Vasama 8f98664fc0 Add verification of Clift module level operations 2024-09-04 10:58:02 +02:00
Lauri Vasama 43399c0462 Add minimal Clift expression operations 2024-09-04 10:58:02 +02:00
Lauri Vasama 9295451b5a Add Clift loop statement operations 2024-09-04 10:58:02 +02:00
Lauri Vasama e8f558cc55 Add custom parser for SwitchOp 2024-09-04 10:58:02 +02:00
Lauri Vasama aceef4e6cc Overhaul Clift statement operations 2024-09-04 10:58:02 +02:00
Lauri Vasama c7b6fb529f Overhaul Clift module-level operations 2024-09-04 10:58:02 +02:00
Lauri Vasama 16797c864f Add named Clift region constraints 2024-09-04 10:58:02 +02:00
Lauri Vasama a3f7b879d2 Add Clift operation traits
* Rename CliftTraits.h to CliftOpTraits.h.
* Add NoFallthrough operation trait.
2024-09-04 10:58:02 +02:00
Lauri Vasama 4a88a8798e Overhaul clift::ModuleOp verify and re-enable test
Re-enabled (a fixed version) of the class type recursion unit test that
was previous disabled to work around a parsing issue. Added another unit
test for indirectly recursive class types and another for recursion via
indirection.
2024-09-04 10:58:02 +02:00
Lauri Vasama a758463cfc Create a block in the clift::ModuleOp::build
SymbolTable requires the operation to have exactly one block.
2024-09-04 10:58:02 +02:00
Lauri Vasama f0d707be70 Fix Clift class type field parsing 2024-09-04 10:58:02 +02:00
Ivan Krysak 94a0ad6b93 Adopt reworked model::Type 2024-06-27 11:07:01 +02:00
Ivan Krysak 3705906074 Model: rename Type into TypeDefinition 2024-06-27 11:07:01 +02:00
Alessandro Di Federico 61358cd862 Clift: adopt revng pipe for unit testing 2024-06-18 17:56:24 +02:00
Pietro Fezzardi 9d24e9372d Clift FieldAttr::verify: improve debug message 2024-06-18 11:17:41 +02:00
Pietro Fezzardi b9ef4b205c Clift parseCompositeType: improve debug messages 2024-06-18 11:17:18 +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 dad3aa5406 Remove unhelpful assert in model type import 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 7ff16c9c2b Add abort on unsupported type in Clift printType 2024-06-05 15:07:23 +02:00
Lauri Vasama 9f7cfa183f Reorganize Clift code 2024-06-05 15:07:23 +02:00
Lauri Vasama 3ebf26bedf Improve static_asserts for kindToKind 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 0c8a04432e Fix use of size_t to represent type ID 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 ba58ec8edb Add import-clift-types pipe 2024-05-29 15:43:35 +02:00
Lauri Vasama a8e2bb8c48 Add ImportModelType pass, register in clift-opt 2024-05-29 15:43:35 +02:00