Commit Graph

32 Commits

Author SHA1 Message Date
Ivan Krysak 71845dcbbb CliftEmitC: stop using mlir::clift namespace 2026-04-22 08:19:47 +00:00
Lauri Vasama 8085a1e8e9 Improve integer literal emission 2026-04-08 12:31:45 +03:00
Lauri Vasama 0e7703e312 CBackend null pointer constant 2026-04-08 12:29:58 +03:00
Lauri Vasama 80731d1a10 Migrate users to new Clift type casts 2026-04-08 12:27:32 +03:00
Lauri Vasama 9ba90e9b81 Replace ValueType with mlir::Type where applicable
`mlir::Type` is now used as the default C++ type for representing all
MLIR types, even when `ValueType` would be a valid constraint, unless
doing so provides a clear benefit in that specific context.
2026-04-08 12:20:00 +03:00
Lauri Vasama f9a4cb6384 Split up clift::dealias
* `unwrapTypedefs` matches `dealias(T, /*IgnoreQualifiers=*/true)`.
* `collapseTypedefs` matches `dealias(T)`.
2026-04-08 12:18:42 +03:00
Lauri Vasama be8351a17d Split up Clift PrimitiveType
* PrimitiveType is now an interface.
* VoidKind is now VoidType.
* FloatKind is now FloatType.
* The integer kinds are now IntegerType with IntegerKind.
2026-04-08 12:18:10 +03:00
Lauri Vasama a2be1b476a Split up Clift CastOp
* DecayOp - array or function to pointer decay. Not shown in C.
* BitCastOp - bit-preserving conversion. Emitted as bit_cast if
  necessary.
* ExtendOp - zero- or sign-extending conversion from any integer type to
  any wider integer type.
* TruncateOp - truncating conversion from any integer type to any
  narrower integer type.
* PtrResizeOp - resizes a pointer without changing its pointee type.
2026-04-08 12:11:54 +03:00
Lauri Vasama c0ca9222ce Fix Clift immediate emission 2026-04-08 11:12:41 +03:00
Ivan Krysak 378bfb650f CliftEmitC: Attributes -> CAttributes 2026-03-27 08:22:23 +00:00
Lauri Vasama ad6f6df04e Improve function arg/result attribute interface 2026-03-27 07:18:49 +00:00
Ivan Krysak b1781988e0 Backend: do not require full attribute presence 2026-03-27 07:18:49 +00:00
Ivan Krysak 1310b6ab62 Clift: append C to attribute classes we emit 2026-03-25 15:42:13 +00:00
Ivan Krysak 41378913b2 CTokenEmitter: add a suffix-less literal helper 2026-03-04 08:20:00 +00:00
Ivan Krysak 5bcccf57d3 CEmitter: rename C field into Tokens 2026-02-25 12:47:27 +01:00
Ivan Krysak 0b2853f624 Extract emitFunctionPrototype helper 2026-02-25 12:47:27 +01:00
Ivan Krysak 22fe32afa2 Minor improvements 2026-02-25 12:47:27 +01:00
Lauri Vasama 07fbf344c2 Implement Clift PTML instruction tag emission 2026-02-13 08:41:39 +02:00
Lauri Vasama 46e8b64bb9 Implement Clift backend statement comment emission 2026-02-13 08:41:39 +02:00
Lauri Vasama 811478771e Make local op name attributes inherent
The handle was already inherent, but was not being used. Discardable
attributes were instead previously used for both handle and name.
2026-02-13 08:41:39 +02:00
Lauri Vasama 8cbc0e6d24 Move CTokenEmitter into namespace ptml 2026-02-11 12:48:33 +02:00
Lauri Vasama a882b245ba Add backend support for immediate radix attributes 2025-12-05 19:53:41 +02:00
Lauri Vasama d4114ae188 Implement bit_cast in Clift backend 2025-12-05 19:53:41 +02:00
Lauri Vasama ba945442d6 Add BlockStatementOp 2025-12-05 15:01:14 +02:00
Lauri Vasama 359af98ab8 Emit spaces before casts in C 2025-11-12 15:28:54 +02:00
Lauri Vasama cee099c2df Rename Clift GoToOp to GotoOp 2025-11-12 15:28:54 +02:00
Lauri Vasama 220439dfce Remove FunctionType::getCliftFunctionType
Change FunctionType::getFunctionType to return clift::FunctionType
instead of clift::ValueType.
2025-11-12 15:28:54 +02:00
Lauri Vasama 02d3c82887 Add support for Clift for-loop initializers 2025-10-21 09:15:40 +02:00
Lauri Vasama bf5adce413 Overhaul Clift loop syntax, add break/continue 2025-10-21 09:15:40 +02:00
Lauri Vasama 34cd63e60c Add CliftOpHelpers.h 2025-10-21 09:15:40 +02:00
Lauri Vasama 143fce8f62 Fix switch statement C emission
No newline was previously emitted before the first case:
```
switch (C) {case 1: {
  } break;
}
```
2025-10-21 09:15:40 +02:00
Lauri Vasama 22d6f70ee2 Clift directory structure overhaul 2025-10-13 15:08:20 +02:00