Commit Graph

7278 Commits

Author SHA1 Message Date
Ivan Krysak 6f1c8edd16 Avoid relative paths in LLVM lit tests 2026-04-22 08:19:31 +00:00
Lauri Vasama cd45c8a831 Avoid relative paths in MLIR lit tests 2026-04-22 08:19:31 +00:00
Ivan Krysak 5f511d8e17 verify-against-model: split into two
The resulting pipes are:
1. binary-granularity one with the name unchanged
2. function-granularity one called `verify-function-against-model`.
2026-04-22 08:19:30 +00:00
Ivan Krysak e693cdbd53 model-verify-clift -> verify-against-model 2026-04-22 08:19:30 +00:00
Ivan Krysak ce7e5a3917 CliftModelVerify: improve error message wording 2026-04-22 08:19:30 +00:00
Ivan Krysak 40a5c76e81 CliftModelVerify: factor error creation out
This heavily improves readability of the messages themselves.
2026-04-22 08:19:29 +00:00
Ivan Krysak b46c54308a Remove unused logic that slipped through 2026-04-22 08:19:29 +00:00
Ivan Krysak 5cc5bf77ed mlir_lit_tests: add header-level comment tests 2026-04-22 08:19:29 +00:00
Ivan Krysak 3de5b009e7 Clift: introduce simple passes for header tests 2026-04-22 08:19:29 +00:00
Ivan Krysak c5130ce689 Clift: factor common ptml pass options out 2026-04-22 08:19:28 +00:00
Ivan Krysak 681df85f5d EmitCPass: separate boilerplate for easier reuse 2026-04-22 08:19:28 +00:00
Ivan Krysak d9acaadfac CBackendPass.cpp -> CEmissionPasses.cpp 2026-04-22 08:19:28 +00:00
Ivan Krysak 7edc4b3da6 CEmitter: emit function type attributes 2026-04-22 08:19:28 +00:00
Ivan Krysak 458cb1f3fe CAttributeListBuilder: expose append method 2026-04-22 08:19:27 +00:00
Ivan Krysak 481f8dba31 CEmitter: emit function comment with prototype 2026-04-22 08:19:27 +00:00
Ivan Krysak 74fa16dd13 Introduce helper header emitter 2026-04-22 08:19:25 +00:00
Ivan Krysak 7ab3d590e0 Introduce type and global header emitter 2026-04-22 08:18:52 +00:00
Ivan Krysak 280d66a441 CTokenEmitter: wrap everything into a <div> 2026-04-22 06:33:56 +00:00
Ivan Krysak c704aac1c5 CEmitter: add emitCategoryComment helper 2026-04-22 06:33:56 +00:00
Ivan Krysak 405eebcbd1 TypeDefinitionEmitter: emit comments 2026-04-22 06:33:56 +00:00
Ivan Krysak 3bd8879948 CEmitter: Introduce doxygen emission helpers 2026-04-22 06:33:56 +00:00
Ivan Krysak 8c3cbcca23 DoxygenEmitter: add internal indentation support 2026-04-22 06:33:56 +00:00
Ivan Krysak 8e456cbca9 CDoxygenEmitter: add one-shot comment helpers 2026-04-22 06:33:56 +00:00
Ivan Krysak 30e8f4e53e CDoxygenEmitter: introduce in-place factories 2026-04-22 06:33:56 +00:00
Ivan Krysak 141bddb241 CDoxygenEmitter: pull factories in as methods 2026-04-22 06:33:56 +00:00
Ivan Krysak 995a94877d CDoxygenEmitter: factor configuration out 2026-04-22 06:33:56 +00:00
Ivan Krysak 2f8557a418 Doxygen unit test: improve the error message 2026-04-22 06:33:56 +00:00
Ivan Krysak d3e22a2b05 CTokenEmitter: add #pragma once helper 2026-04-22 06:33:56 +00:00
Ivan Krysak 6d76908858 Introduce TypeDefinitionEmitter 2026-04-22 06:33:38 +00:00
Ivan Krysak d327cd3be5 emitCAttributes: introduce an array overload 2026-04-22 06:14:52 +00:00
Ivan Krysak 539a8370c6 CAttributeListBuilder: allow chaining the methods
This lets callees do stuff like:
```cpp
CAttributeListBuilder{Context}
  .setOrUpdate<"_MY_ATTRIBUTE_1">()
  .setOrUpdate<"_MY_ATTRIBUTE_2">()
  .setOrUpdate<"_MY_ATTRIBUTE_3">()
  .get()
```
2026-04-22 06:14:52 +00:00
Ivan Krysak 0189089930 Introduce TypeEmitterConfiguration 2026-04-22 06:14:52 +00:00
Ivan Krysak c3b870beee CEmitter: make function prototype commentable
This wraps pieces of it (arguments and return value) into a commentable
region showing the UI where to direct the `"comment"` action.
2026-04-22 06:14:52 +00:00
Ivan Krysak 3e63412e8c CEmitter: make return value scope
This commit should be viewed in conjunction with the following one,
separating white-space only changes makes the next commit less noisy.
2026-04-22 06:14:52 +00:00
Ivan Krysak f69a0345b7 CTokenEmitter: introduce Commentable region 2026-04-22 06:14:52 +00:00
Ivan Krysak ac3df7460d Introduce clift::ClassType::getCAttributes 2026-04-22 06:14:52 +00:00
Ivan Krysak 9167153303 Only allow unit attributes on function operations 2026-04-22 06:14:52 +00:00
Ivan Krysak 58cff91c3b CTokenEmitter: allow identifiers in comments 2026-04-22 06:14:52 +00:00
Ivan Krysak 2f692a7265 Fix unnecessary _CAN_CONTAIN_CODE bug 2026-04-22 06:14:52 +00:00
Ivan Krysak f1739e1a0f IndentingEmitter: drop emitNewline 2026-04-22 06:14:50 +00:00
Ivan Krysak f3df0e20b9 Minor improvements 2026-04-21 07:54:50 +00:00
Pietro Fezzardi 15196ecdc5 Merge branch feature/emit-field-accesses-indirect 2026-04-14 11:23:20 +02:00
Andrea Gussoni 4e3af009fe Expressions: fold x[0] into *x
Implement a DDR rewriting for folding the `x[0]` into `*x`, in order
to avoid a useless verbose syntax. Due to concatenation of rewrites, we
will get `&(x[0])` transformed into `x`, which is the rewriting we are
aiming to.
2026-04-14 09:52:07 +02:00
Andrea Gussoni 8359b4da26 EmitFieldAccesses: indirection propagation test 2026-04-14 09:50:48 +02:00
Andrea Gussoni 8a87c034a8 EmitFieldAccesses: re-run on indirection
Re-run the emit-field-accesses if any replacement propagates a type
through an IndirectionOp. This is needed to discover new rewriting
opportunities enabled by the newly typed pointers.
2026-04-14 09:50:48 +02:00
Andrea Gussoni 0e63c46930 EmitFieldAccesses: propagate through indirection
After a replacement, check if the replaced value feeds into an
IndirectionOp. If the "rich" pre-bitcast value has a ptr<ptr<T>>
type, create a new typed IndirectionOp and insert a fixup bitcast
for existing non-lvalue uses. Lvalue uses (assign LHS) stay on the
old indirection to preserve type and lvalue constraints.

Returns true if propagation occurred, signaling the EFA driver to
rerun and discover new rewriting opportunities.
2026-04-14 09:50:48 +02:00
Andrea Gussoni f6b1772bbd EmitFieldAccesses: add const-qualified test 2026-04-14 09:50:48 +02:00
Andrea Gussoni e0a9f4f484 EmitFieldAccesses: ignore qualifiers on Types 2026-04-14 09:24:48 +02:00
Pietro Fezzardi 715a2e54b0 IndentingEmitter: initialize IndentationString 2026-04-13 11:39:55 +02:00
Pietro Fezzardi fa5b9c99c2 Merge branch 'feature/prepare-sts-alias-analysis' 2026-04-10 16:06:02 +02:00