Commit Graph

1157 Commits

Author SHA1 Message Date
Ivan Krysak 17557a65d1 Minor improvements 2024-03-18 13:27:53 +00:00
Ivan Krysak bedbf7c1d9 EFA: split importModel into multiple methods 2024-03-18 14:27:47 +01:00
Ivan Krysak 3fbaaeaaf5 STLExtras: introduce revng::to helper 2024-03-18 12:24:21 +00:00
Ivan Krysak b4e4d73d49 Layout: introduce usedRegisters helper 2024-03-18 12:24:21 +00:00
Ivan Krysak 894c3e7b5c TrackingContainer: introduce asVector helper 2024-03-18 12:24:21 +00:00
Ivan Krysak 80375de3cb Layout: introduce finalStackOffset helper 2024-03-18 12:24:21 +00:00
Ivan Krysak b46649de71 Layout: introduce calleeSavedRegisters helper 2024-03-18 12:24:21 +00:00
Ivan Krysak c003a62212 Layout: rework dump 2024-03-18 12:24:21 +00:00
Ivan Krysak bf11370fc5 Layout: clean ArgumentKind enum up 2024-03-18 12:24:21 +00:00
Alessandro Di Federico e93d8ba09f RawBinaryView:getByOffset: fix of by = 2024-03-15 17:13:20 +01:00
Alessandro Di Federico 0da9d1e1a4 Model: fix handling of 0-sized arguments
We used to support having a single `void` argument. It was for some
C-compatibility ambitions, but just omitting the argument is perfectly
fine.

Also, the DWARF importer has been fixed to handle typedef'd void as
arguments.

More in general, arguments are now required to always have a size.
2024-03-01 14:53:06 +01:00
Ivan Krysak e708a3655b ABI: drop incomplete clrcall support 2024-02-09 15:09:37 +00:00
Ivan Krysak b1ed3aa959 AccessTracker: make an assertion more obvious
It's pretty confusing for a nullptr access to fail on the same line as
an existing assert, which is why it's better to move them to separate
lines.
2024-02-09 15:09:37 +00:00
Ivan Krysak e62d4f79ef ABI: remove an obsolete definition parameter
Since pointer to copy system got straightenned up, the old way of
marking them (`abi::Definition::UsePointerToCopyForStackArguments`)
is no longer needed.
2024-02-09 15:09:37 +00:00
Ivan Krysak 27491410d6 ABI: introduce a way to disable vector registers 2024-02-09 15:09:37 +00:00
Ivan Krysak fe025e37ef ABI: short-circuit zero-offset to always be zero 2024-02-09 15:09:37 +00:00
Ivan Krysak 68301138c0 ABI: redesign register sorting from the ground up 2024-02-09 15:09:37 +00:00
Ivan Krysak 5bf4b3fa1e ABI: improve robustness to duplicate registers 2024-02-09 15:09:37 +00:00
Ivan Krysak 9d815d79ec ToRaw: take advantage of the updated distributor
This lets us drop the repeated alignment calculations at
the "leaves" of the conversion. Since new distributor already
provides the necessary information, we can just grab it from
there.
2024-02-09 15:09:37 +00:00
Ivan Krysak 4e81a34cd7 ABI: separate 'gcc' editions of microsoft ABIs 2024-02-09 15:09:37 +00:00
Ivan Krysak 3fdd7d8e8a ABI: introduce a way to set stack argument offset 2024-02-09 15:09:37 +00:00
Ivan Krysak d2fe578091 ABI: add getArchitecture helper 2024-02-09 15:09:37 +00:00
Ivan Krysak f1f6fc5e12 ABI: assert on 0-sized stack arguments 2024-02-09 15:09:37 +00:00
Ivan Krysak fffd62391c Model: introduce hasMetadata helper 2024-02-09 15:09:37 +00:00
Alessandro Di Federico 346b367c19 Drop revng efa-extractcfg 2024-02-09 10:04:25 +01:00
Alessandro Di Federico d9367954a4 Convert all public strings to kebab-case 2024-02-09 10:04:24 +01:00
Alessandro Di Federico 944f827ae3 Drop obsolete +yaml MIME types 2024-02-09 10:04:21 +01:00
Alessandro Di Federico f2be46d4da ToolCLOptions: introduce --model 2024-02-09 10:04:21 +01:00
Alessandro Di Federico 5fbb5ff503 Minor changes 2024-02-09 10:04:17 +01:00
Ivan Krysak 78510010f8 ABI: rename isIncompatibleWith
The new name is `isPreliminarilyCompatibleWith`.
2024-01-29 11:57:54 +02:00
Ivan Krysak e7c456afd2 ABI: improve register state deduction docs 2024-01-29 11:57:54 +02:00
Ivan Krysak 4cb38a722c ABI: disallow ABI flags to be optional 2024-01-29 11:57:54 +02:00
Ivan Krysak 4093cd30c4 ABI: provide alignment computation for model::Type 2024-01-29 11:57:54 +02:00
Ivan Krysak 386cb26f6d ABI: introduce a new ABI configuration option
It's called `AllowUnnaturallyAlignedTypesInRegisters` and explicitly
allows weirdly aligned structs in registers.
2024-01-29 11:57:54 +02:00
Ivan Krysak 16dc85cb0f ABI: improve unnatural alignment support 2024-01-29 11:57:54 +02:00
Ivan Krysak 54ffd723e6 ABI: decouple alignment from model::VerifyHelper 2024-01-29 11:57:54 +02:00
Ivan Krysak 7fae2e4522 STLExtras: introduce takeAsTuple
It's a useful shorthand for the cases where one only cares about
a constant number of top values in a range (i.e. first three elements of
a vector) and wants them as named variables. It can be used as:
`auto [First, Second, Third] = takeAsTuple<3>(MyVector)`.
2024-01-29 11:57:54 +02:00
Ivan Krysak 3068cd219e compile_time: add a tuple repeat overload
Based on the passed `Callable`, it either behaves as previously,
or returns a `std::tie`'d version of all the values returned by it.
2024-01-29 11:57:54 +02:00
Ivan Krysak a2ef041cb2 Move TypeBucket to the model 2024-01-29 11:57:54 +02:00
Ivan Krysak 77b1acaf00 Prefer uint64_t to size_t wherever relevant 2024-01-29 11:57:54 +02:00
Ivan Krysak f67030214f STLExtras: add to_underlying 2024-01-29 11:57:54 +02:00
Ivan Krysak b25a32de2a Stop using std:: prefix for std::size_t 2024-01-29 11:57:54 +02:00
Ivan Krysak 15be26f9fa Minor Improvements 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 fc4c91e333 Introduce PopulateTargetListContainer
This commit adds the `TargetListContainer` container that allows storing
a list of target for a fixed Kind. Moreover the
`PopulateTargetListContainer` pipe has been added that allows adding all
targets to a `TargetListContainer` from a `Kind` via the
`appendAllTargets` method.
2024-01-26 19:13:58 +01:00
Giacomo Vercesi 11938e40da Introduce TypeStringMap
Building upon the previous commit, introduce `TypeStringMap` which is a
container for type-wise strings.
2024-01-26 19:13:58 +01:00
Giacomo Vercesi 5f8143207d Generalize FunctionStringMap
Generalize `FunctionStringMap` into `detail::GenericStringMap`, which
supports any `Depth=1` rank. `FunctionStringMap` remains as an `using`
with `Rank = ranks::Function`.
2024-01-26 19:13:58 +01:00
Giacomo Vercesi ca3fb32aeb Fix Step::invalidationMetadataContains
This commit fixes the `Step::invalidationMetadataContains` function
since it returned an inverted result.
2024-01-26 19:13:58 +01:00
Giacomo Vercesi 6ac7c0c557 Implement container cache pruning
Implement the pruning of container caches (resume directory) when there
is a mismatch between the current revng components' hash and the saved
one. This functionality is activated via `-check-components-version`.
2024-01-26 17:46:21 +01:00
Giacomo Vercesi 06f6137004 ResourceFinder: implement getComponentsHash
Implement the `getComponentsHash` function which returns a hash string
for all the components currently installed in revng.
2024-01-26 17:46:21 +01:00