3016 Commits

Author SHA1 Message Date
Ivan Krysak c1f05e4d24 Ranks: introduce the macro location 2026-02-27 18:28:12 +00:00
Ivan Krysak 1a91707a2b GenericGraph: introduce empty() method 2026-02-25 14:10:44 +01:00
Ivan Krysak 1c56e34350 NameBuilder: introduce isAutomaticName 2026-02-25 14:10:44 +01:00
Ivan Krysak 8a6706e7ac Doxygen: leave a TODO 2026-02-25 14:10:44 +01:00
Ivan Krysak 1541d4b402 CEmitter: allow argumentless function declarations 2026-02-25 12:47:27 +01:00
Ivan Krysak 4514620e9f CEmitter: introduce chooseEntityKind helper 2026-02-25 12:47:27 +01:00
Ivan Krysak 83304a14df Annotations: introduce a way to assert the name 2026-02-25 12:47:27 +01:00
Ivan Krysak 91ed5e33a8 PTML: make enum scope named for consistency sake 2026-02-25 12:47:27 +01:00
Ivan Krysak 5bcccf57d3 CEmitter: rename C field into Tokens 2026-02-25 12:47:27 +01:00
Ivan Krysak f73bbf7a08 Annotation: expose raw access
This allows the existing annotation registry to be reused in a more
convenient nature. Before now, it was only used for *parsing* or,
rather, *verifying* annotations. Now that we can take advantage of
it for emission as well, there's more control it needs to provide
in particular as far as annotation arguments are concerned.
2026-02-25 12:47:27 +01:00
Ivan Krysak 0b2853f624 Extract emitFunctionPrototype helper 2026-02-25 12:47:27 +01:00
Ivan Krysak f0e00d66ab Do not use doxygen for TODOs 2026-02-25 12:47:27 +01:00
Ivan Krysak 22fe32afa2 Minor improvements 2026-02-25 12:47:27 +01:00
Ivan Krysak b5f98fcae9 check-conventions: ban anonymous header namespaces 2026-02-25 12:47:27 +01:00
Giacomo Vercesi f1878f1194 pypeline: drop TraceRunner
Drop the `pypeline-trace-run` executable, as its purposed has been
superseded by the combination of `--debug` and native pipe/analysis
runners.
2026-02-16 10:34:39 +01:00
Giacomo Vercesi 25ba3115c4 pypeline: implement native run-{pipe,analysis}
Implement C++-only command-line executables that allow running a single
pipe/analysis without the involvement of python.
2026-02-16 10:34:38 +01:00
Giacomo Vercesi 27f419c8cd Fix and ban namespace clobbering
Fix an instance where the `std` namespace got clobbered into the global
namespace by accident.
2026-02-16 10:34:38 +01:00
Lauri Vasama d37d32e4b2 Add Clift function type to-do 2026-02-13 08:41:39 +02: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 b0139bd5e5 Add stack frame variable rank 2026-02-13 08:41:39 +02:00
Lauri Vasama 4c5544816a Enable explicit automatic naming for locals 2026-02-13 08:41:39 +02:00
Lauri Vasama 6947a31a0c Add stack frame variable automatic naming 2026-02-13 08:41:39 +02:00
Lauri Vasama cb95b94785 Rename StackFrameVariableName 2026-02-13 08:41:39 +02:00
Lauri Vasama aa2597d13b model::Function: add stack frame name and comment
* StackFrameType() is removed.
* StackFrame() is introduced in its place.
* Use StackFrame().Type() to acess the stack frame type.
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 47f030248c Add ExpressionRegionOpInterface 2026-02-13 08:41:39 +02:00
Lauri Vasama ba9c756d07 Improve StatementRegionOpInterface 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 f65ca96368 Add clift op interface descriptions 2026-02-11 12:48:33 +02:00
Lauri Vasama 8cbc0e6d24 Move CTokenEmitter into namespace ptml 2026-02-11 12:48:33 +02:00
Giacomo Vercesi d578bc6cd2 isolate: clone root module conservatively
In the new pipeline the root module is split off in its individual
isolated modules at the end of `isolate`. Before splitting, there are a
lot of global variables in the root module and only a small part is
going to be needed after splitting for each module. To avoid excessive
memory usage employ `ConservativeModuleCloner` in `Isolate` so that
only the needed global variables are actually cloned when splitting off.
2026-02-05 10:20:45 +01:00
Giacomo Vercesi 798af62b87 Introduce helpers declarations
Re-organize the variants of `libtcg-helpers-*.bc` as such:
* `libtcg-helpers-full-$ARCH.bc`: unchanged, contains all helper
  function with their bodies and all CSVs.
* `libtcg-helpers-declarations-only-$ARCH.bc`: all helper
  functions have been turned to declarations. All CSVs (except a couple
  of special ones) have been dropped.
* `libtcg-helpers-to-inline-$ARCH.bc`: only functions with the
  `revng_inline` section retain their body. Only CSVs that are used by
  these functions are present.

Lift now loads only the `declarations-only` variant of helpers, as
their body is not required until `inline-helpers`. In `inline-helpers`
the `to-inline` variant is loaded and linked, which then allows the
helpers to be inlined.
2026-02-05 10:20:45 +01:00
Giacomo Vercesi 5250ffbb6b Introduce SimplePassManager
Add the `SimplePassManager` and `SimpleFunctionPassManager` classes
which add wrappers around the new LLVM pass manager. Change all the
applicable uses of the legacy pass manager with the wrapper.
2026-02-05 09:25:42 +01:00
Giacomo Vercesi 0ba82ce4f9 GCBI: explicitly store module reference
When calling `programCounterHandler`, instead of relying on the presence
of the `root` function, which might be absent, use a guaranteed
reference to the module.
2026-02-05 09:25:42 +01:00
Giacomo Vercesi 723ae8d801 GCBI: rework members and constructor
Move member declaration to the top of the class definition of
`GeneratedCodeBasicInfo` and initialize primitive members.
Merge the `run` method into the constructor since all uses have them
happening close to each other.
2026-02-05 09:25:42 +01:00
Giacomo Vercesi 54b84de3ea CUniquePtr: add missing #include 2026-01-20 12:29:12 +01:00
Alessandro Di Federico afa52dfbd5 BinaryImporterHelper: use executableRanges
This ensures we don't create functions at addresses in a zone where
executable code is not allowed, despite being in a +x segment.
2025-12-22 11:34:47 +01:00
Alessandro Di Federico 250e69fdc7 Introduce MetaAddressRange 2025-12-22 11:34:47 +01:00
Alessandro Di Federico 4d5183a0ac Make layoutToLLVMFunctionType self-contained
`layoutToLLVMFunctionType` no longer needs to know the old return type.
2025-12-22 11:34:47 +01:00
Alessandro Di Federico 0bf97a9e68 getPointerSizedInteger: use model::Architecture
No need to get model::Binary.
2025-12-22 11:34:47 +01:00
Alessandro Di Federico d79c66cb1b Introduce getOrCreateGlobal 2025-12-22 11:34:47 +01:00
Alessandro Di Federico ce4f6ef996 llvmName: turn into a free function 2025-12-22 11:34:46 +01:00