84 Commits

Author SHA1 Message Date
Alessandro Di Federico 5820908675 Remove and ban \file 2025-12-16 17:41:55 +01:00
Ivan Krysak 288448f009 Never include model::VerifyHelper from headers 2025-02-13 13:09:50 +02:00
Ivan Krysak dfa7478685 Adopt reworked model::Type 2024-06-27 11:05:51 +02:00
Ivan Krysak 925690a1e1 VerifyHelper: reduce pointer usage 2024-06-27 11:05:50 +02:00
Ivan Krysak 277cba213c Model: separate verification 2024-06-27 11:05:49 +02:00
Ivan Krysak 9e6bf29f74 TTG: pull dump helper into the template 2024-06-27 11:05:49 +02:00
Ivan Krysak 927e8006b9 Model: rename TypePath to DefinitionReference 2024-06-27 11:05:49 +02:00
Ivan Krysak 35444268b3 TTG: strip Kind from the child constructor 2024-06-27 11:05:49 +02:00
Ivan Krysak ac587cbb4f Model: rename Type into TypeDefinition 2024-06-27 11:05:48 +02:00
Ivan Krysak 26c68b78ea Model: drop makeTypeWithID 2024-06-27 11:05:48 +02:00
Ivan Krysak 84c8822c37 Model: drop TypedRegister 2024-06-27 11:05:48 +02:00
Alessandro Di Federico f60c1bb4ad s/TrackGuard/DisableTracking/ 2024-06-20 10:24:51 +02:00
Lauri Vasama 3e33a300d5 Introduce RawFunctionType::Architecture 2024-05-29 15:42:15 +02:00
Alessandro Di Federico ffe93548c5 Model ::size(): do not suspend tracking 2024-03-01 14:53:07 +01:00
Alessandro Di Federico 6f4923265e Type verify: improve error reporting 2024-03-01 14:53:06 +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 2e78369ec9 Model: disable float register size mismatch check 2024-02-09 15:09:37 +00:00
Massimo Fioravanti c276a439b5 Add pipeline invalidation
Replace the stub implementation of invalidation with the proper
implementation. A ReadPathCache is added to each global so that it can
keep tracks of what target are associated to which read paths.
2024-01-02 11:14:56 +01:00
Giacomo Vercesi 8504a96020 RawFunctionType: use NamedTypedRegister for return
Use the `NamedTypedRegister` type for return values in
`RawFunctionType`. This allows return values to be renamed at the user's
discretion.
2023-12-11 12:03:45 +01:00
Giacomo Vercesi 37ef77933c NamedTypedRegister: change name to use 'register'
Change the prefix used by `NamedTypedRegister` when `CustomName` is not
present from `_argument_` to `_register_`.
2023-12-11 10:21:02 +01:00
Pietro Fezzardi 1285c6e7af Make RawFunctionType::StackArgumentsType a TTR
This is homogeneous with all other nullable references to types in the
model, such as the StackFrameType in model::Function, and others.
2023-12-05 16:19:38 +01:00
Ivan Krysak cfe28d8e56 Stop using std:: prefix for u?int\d+_t types 2023-11-02 17:10:03 +01:00
Alessandro Di Federico bf66ecc389 {,Dynamic}Function::Prototype: support typedefs 2023-10-05 10:19:44 +02:00
Alessandro Di Federico b5aa75f1f1 Introduce model::PrimitiveType::fromName 2023-08-23 16:14:05 +02:00
Alessandro Di Federico f51af94e8f TupleTreeReference::isValid is for assertions only 2023-08-23 16:14:05 +02:00
Alessandro Di Federico a5b380b201 Model: rework how we name things
This commit improves the formalization of how we handle names.

The main changes are:

* Now `_` is a reserved prefix and all the generated names start with
  `_`.
* The model verification routine now checks that `CustomName`s in the
  global scope do not collide with any local namespace (e.g., fields of
  a `StructType`).
* We changed the prefix `prefix_` to `unreserved_` to better convey the
  fact that the prefix has been introduce to use an non-reserved name.
2023-08-23 16:14:04 +02:00
Alessandro Di Federico 247879f7fc model::Type::ID: switch to progressive IDs
This commit switches `model::Type::ID` from being a GUID to be a
progressive number, in order to make things easier for humans.

On top of this, this commit introduces the following changes:

* TypeCopier: import all the necessary PrimitiveTypes and improve
  handling of CustomName.
* Move Kind as the last field of the key of each TupleTree type used in
  an `UpcastablePointer`.
* Update the ground truth of tests to ignore the `CustomName` in favor
  of focusing on `OriginalName`.
* Increase adoption of `model::Binary::makeType`, equivalent to
  `Binary.recordNewType(makeType<model::*Type>())`.
2023-08-23 16:14:04 +02:00
Alessandro Di Federico 56268e94b0 VerifyHelper: handle fail in type verification
Before this commit, if there was a failure during the verification of a
type (which is recursive), we'd get an assertion in ~VerifyHelper due to
a "pending" type still being verified.
2023-08-23 16:14:04 +02:00
Alessandro Di Federico b8b483d052 Minor changes 2023-08-23 16:14:04 +02:00
Ivan Krysak 485ef34a12 Model: add Comment field all across the board 2023-07-21 17:25:24 +02:00
Ivan Krysak 8a9b253314 Model: clean type constructors up 2023-07-21 17:25:24 +02:00
Ivan Krysak 9f1d9fd5d0 Use Container::contains() where appropriate 2023-07-02 15:06:11 +00:00
Ivan Krysak bc98e0079f Formatting: change PenaltyReturnTypeOnItsOwnLine
The new value is 21.
2023-07-02 13:20:49 +02:00
Ivan Krysak b19572ea67 Model: Leave a note about the alignment 2023-03-15 10:19:02 +01:00
Ivan Krysak 84229d92b1 Model & ABI: make size and alignment stricter 2023-03-15 10:19:02 +01:00
Ivan Krysak 0b1aaeaede Minor improvements 2023-03-15 10:19:01 +01:00
Massimo Fioravanti 4dc2e92782 Introduce DocumentError
`DocumentError`s are the inteded way of propagating errors from the
pipeline to the frontend when a location is required to inform the user
of the error whereabouts.
2023-02-09 13:42:50 +01:00
Djordje Todorovic 961f9e5461 Model: search debug info locally upon import
Also find prototypes in Models of dynamic libs for both PE and ELF.
2022-12-13 11:26:54 +01:00
Massimo Fioravanti 742e1a0c56 TupleTree: switch from public fields to accessors 2022-12-12 18:36:57 +01:00
Alessandro Di Federico 693b361e4a TupleTree: externalize several methods 2022-12-09 09:08:40 +01:00
Pietro Fezzardi df30792435 PrimitiveType: support for 80 and 96 bits types
This commit completes the support of various rare PrimitiveTypes, that
has been added opportunistically over time and has remained inconsistent
across the codebase:

- float80_t
- float96_t
- generic80_t
- generic96_t

The first two are necessary because on some platforms long double is
either 10 or 12 bytes wide.

The second two are necessary because the Generic PrimitiveType should
allow all non-zero byte sizes allowed by any other PrimitiveType.
2022-11-30 15:06:54 +01:00
Pietro Fezzardi 8bf90e8bfd QualifiedType::isScalar: true for model::EnumType 2022-11-30 15:06:54 +01:00
Ivan Krysak 207668070a QualifiedType: add argument-less isPrimitive() 2022-11-30 15:06:54 +01:00
Pietro Fezzardi fd0914b460 QualifiedType: add isConst method 2022-11-22 10:12:31 +01:00
Alvise de Faveri 999df25246 Add revng model export type-graph tool
This tools dumps a type, a function or an entire type-system to a
dot file,representing dependencies between types as edges.
2022-09-19 08:35:06 +02:00
Djordje Todorovic a36e22729f Model: Add PDB support 2022-07-28 14:52:50 +02:00
Antonio Frighetto 4bc21328d8 Model: reserve type prefixes 2022-07-22 16:10:51 +02:00
Alvise de Faveri a3110c0b59 Add QualifiedType::is(TypeKind) 2022-04-20 11:25:46 +02:00
Massimo Fioravanti 44720eedbd Redesign TupleTreeDiff
`TupleTreeDiff` is now type-safe and owns the changes.
2022-04-15 15:14:13 +02:00
Pietro Fezzardi 6b2b2e8ada Make model::Type::edges() method const 2022-04-08 18:58:58 +02:00