Commit Graph

65 Commits

Author SHA1 Message Date
Ivan Krysak 9de53e434d CAttributes: introduce _NORETURN 2026-03-27 08:24:10 +00:00
Ivan Krysak 446e8cb88d CAttributes: introduce _ALWAYS_INLINE 2026-03-27 08:23:31 +00:00
Ivan Krysak fad05621cc CAttributes: drop IsReal property 2026-03-27 08:22:52 +00:00
Ivan Krysak 729b025de3 CAttributes.h: move back to PTML
When `revng` and `revng-c` were being merged, this header founds its
way into `revngSupport` even though it makes more sense under the PTML
umbrella.
2026-03-27 07:19:27 +00:00
Ivan Krysak 41378913b2 CTokenEmitter: add a suffix-less literal helper 2026-03-04 08:20:00 +00:00
Ivan Krysak b63102ed12 CTokenEmitter: introduce Macro entity kind 2026-02-27 18:28:12 +00:00
Ivan Krysak 3bec80c9ba PTML: introduce c.macro token type 2026-02-27 18:28:12 +00:00
Ivan Krysak 8a6706e7ac Doxygen: leave a TODO 2026-02-25 14:10:44 +01:00
Ivan Krysak 91ed5e33a8 PTML: make enum scope named for consistency sake 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 60e1684127 Generalize CommentPlacementHelper 2026-02-13 08:41:39 +02:00
Lauri Vasama 757f278134 Add ptml::DoxygenEmitter, CDoxygenEmitter
These streams allow emitting Doxygen comments in C and other languages
using various Doxygen style options.
2026-02-13 08:41:39 +02:00
Lauri Vasama 17c173b3d9 Add CTokenEmitter::CommentEmitter interface 2026-02-13 08:41:39 +02:00
Lauri Vasama c93e9f17fc Add CTokenEmitter documentation 2026-02-13 08:41:39 +02:00
Lauri Vasama 61cbd93bab Overhaul PTMLEmitter
* PTMLEmitter is now a concept subsuming Emitter.
* PTMLStreamEmitter is a concrete emitter implementing PTMLEmitter.
* Indentation no longer includes PTML tags.
* PTMLTagEmitter is no longer default-constructible or reusable.
2026-02-13 08:39:03 +02:00
Lauri Vasama e127f433ad Factor indentation out of ptml::Emitter 2026-02-11 12:50:40 +02:00
Lauri Vasama 21fa80f831 Introduce ptml::Emitter concept 2026-02-11 12:48:33 +02:00
Lauri Vasama 021d99cc39 Rename ptml::Emitter to ptml::PTMLEmitter 2026-02-11 12:48:33 +02:00
Lauri Vasama 04b035749b Add ptml::tokens::Punctuation 2026-02-11 12:48:33 +02:00
Lauri Vasama 8cbc0e6d24 Move CTokenEmitter into namespace ptml 2026-02-11 12:48:33 +02:00
Lauri Vasama 18773ba22c Add Clift declaration attribute support 2025-09-29 18:05:55 +03:00
Lauri Vasama 6839ce4208 Add streaming CTokenEmitter interface 2025-09-29 18:05:55 +03:00
Lauri Vasama c3fd7d67a0 Add streaming ptml::Emitter interface 2025-09-29 18:05:55 +03:00
Ivan Krysak c7bba8c1b9 Prevent Support headers from depending on PTML 2025-05-08 15:42:01 +02:00
Ivan Krysak 872d6016a5 Doxygen: allow suppressing newlines before comment 2025-05-08 15:42:01 +02:00
Ivan Krysak fa2f243f12 PTML: avoid auto in constexpr string literals 2025-05-08 15:42:00 +02:00
Ivan Krysak 66b42298de PTML: Emit a location for statement comments 2025-05-08 15:42:00 +02:00
Ivan Krysak 0d868894a2 model::Function: switch to indices as comment keys 2025-05-08 15:42:00 +02:00
Ivan Krysak c6e38cd485 Return to using constant name builders
Because of how name builders used to lazy gather namespaces on the first
requested name, the objects were self mutating. As such only non-const
references could be used to pass them around.

Since that is no longer the case, this restores most of lost const
qualifiers.
2025-04-17 11:19:17 +03:00
Ivan Krysak 57b5eb7f98 NameBuilder: allow different name checkers 2025-04-17 11:19:17 +03:00
Ivan Krysak 3edb6cbb9b Minor improvements 2025-04-15 16:35:42 +03:00
Ivan Krysak 705e4a5955 auto [...] -> auto &&[...] 2025-02-13 13:10:51 +02:00
Ivan Krysak 9082c500cb IndentedOstream: introduce currentIndentation() 2025-02-13 13:09:50 +02:00
Ivan Krysak d4ab801ab7 Rename range_with_value_type into RangeOf
Original name was reminiscent of the STL, but there's no such concept
in there, as such it's probably better to use revng naming convention
instead.
2025-02-13 13:09:50 +02:00
Ivan Krysak 1c9b6a70db PTML: add statement comment support 2025-02-13 13:09:50 +02:00
Ivan Krysak a4550ce7e6 PTML: introduce comment placement helper 2025-02-13 13:09:50 +02:00
Ivan Krysak 288448f009 Never include model::VerifyHelper from headers 2025-02-13 13:09:50 +02:00
Ivan Krysak 929cb4b35b Minor improvements 2025-02-13 13:09:50 +02:00
Ivan Krysak a67ba96644 Adopt name builder across the model users 2024-11-06 15:43:13 +02:00
Ivan Krysak 99e966f6e8 ptml::TagBuilder: rename GenerateTagLessPTML
The new name is `IsInTaglessMode`.

This also makes it public, since their no point of keeping a const
option private.
2024-10-15 09:12:55 +02:00
Ivan Krysak c057ba335e ptml::IndentedOstream: accept a builder reference
This avoids the need to have duplicated builders in cases were we
already have one at the cost of always having to manually create one.
2024-10-15 09:12:55 +02:00
Ivan Krysak 9ebe98e5c8 PTMLIndentedOstream: rename into IndentedOstream 2024-10-15 09:12:55 +02:00
Ivan Krysak ec19b26ee9 PTMLBuilder: rename into ptml::MarkupBuilder 2024-10-15 09:12:55 +02:00
Alessandro Di Federico 2cdedc71f4 s/serialize/toString/
We keep serialize for method dealing with streams.
If it returns a `std::string`, let's use `toString`.
2024-09-27 12:07:17 +02:00
Ivan Krysak 51208789a0 Rename ThePTMLBuilder into just B 2024-06-27 11:05:51 +02:00
Ivan Krysak b25a32de2a Stop using std:: prefix for std::size_t 2024-01-29 11:57:54 +02:00
Giacomo Vercesi 92e90d554c PTML/Constants.h: add editType action 2024-01-26 19:13:58 +01:00
Giacomo Vercesi db1691b03f Adopt new PTML tags
Change the emitted disassembly to include the
`data-action-context-location` and `data-name-of` tags.
2023-11-03 16:30:40 +01:00
Giacomo Vercesi f77d4d6d1f PTML: introduce data-scope-location
Introduce the new `data-scope-location` tag that's to be used for
switching between C and ASM. Include the tag when generating ASM
instructions.
2023-07-31 16:05:51 +02:00