Commit Graph

2366 Commits

Author SHA1 Message Date
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 a207ef7c44 Minor changes 2023-08-23 16:12:51 +02:00
Pietro Fezzardi 4e32f05aba DLA: mergeNodes now uses ArrayRef argument
This allows for a greater flexibility in its users.
2023-08-21 16:17:36 +02:00
Pietro Fezzardi cac7fee07d LayoutTypeSystemNode: add NonScalar field
This field represents that fact that a node of the DLA Graph is not a
scalar and it comes from the Model.
2023-08-21 16:17:36 +02:00
Pietro Fezzardi 72bedb7dfd TypeSystemPrinter: print DynamicFunctions 2023-08-21 12:29:31 +02:00
Pietro Fezzardi 2120dd8108 Replace revng_unreachable with revng_abort
This ensures that we always detect nasty failures even in release
builds.
2023-08-18 15:48:55 +02:00
Pietro Fezzardi dfbb9a15b2 Backend: declare local variables for aggregates 2023-08-18 15:48:55 +02:00
Alessandro Di Federico e9470d6329 Pipeline: improve naming and docs 2023-08-01 12:17:20 +02:00
Alessandro Di Federico 14525d91f5 Adopt llvm::Task 2023-08-01 10:51:16 +02:00
Alessandro Di Federico b188f91863 Introduce ContainerToTargetsMap::size() 2023-08-01 10:51:15 +02:00
Giacomo Vercesi 9ea7d361f6 BinaryCrossRelations: fix mime type
Change the mime type of `BinaryCrossRelations` to `text/x.yaml`, so that
it's not base64-encoded when transmitting over GraphQL.
2023-07-31 16:05:52 +02: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
Giacomo Vercesi db7ad24175 PipelineManager: add produceTargets with checks
Move much of the logic of `rp_manager_produce_targets` to a method
inside `PipelineManager`, add additional checks for the existence of the
targets that are requested to be produced.
2023-07-31 16:05:51 +02:00
Kacper Kołodziej 46e9ea0e10 HexDump implementation
HexDumpPipe dumps content of binary file in the similar way as hexdump
tool with addition of PTML markup for instructions addresses.

Continuous parts of binary code are wrapped with <span
data-location-definition=""></span> where data-location-definition
attribute contains Entry/BasicBlock/Instruction addresses in generic
form. <span> tags can be nested if byte(s) belong to many instructions
in code.

At the end of the line every <span> is closed and opened on the next
line again if it still applies to the next byte.

MetaAddress are converted to IntervalMetaAddress (which implements own,
optional-less operator-) and stored in boost::icl::intruval_map. This
map is used to get addresses of instructions to which each byte belongs.
2023-07-31 11:29:41 +02:00
Kacper Kołodziej c0f226fa70 Add const qualifiers to some functions
getJumpTargetBlock takes llvm::BasicBlock * as argument, but doesn't
need to modify it, so const it adds const to it and other functions that
are used by getJumpTargetBlock: findJumpTarget, isTranslated, getType,
isJumpTarget.
2023-07-31 11:29:40 +02:00
Kacper Kołodziej 7bec0190e8 Fix spelling in docstring 2023-07-31 11:29:40 +02:00
Pietro Fezzardi 755b5176cf Drop unused method LayoutTypeSystem::getNodePtr 2023-07-26 10:41:18 +02:00
Alessandro Di Federico 6ed958d614 Improve TypeShrinking
This commit fixes a TypeShrinking bug and extends it to better handle
more instructions. Specifically, we now handle shift left, select, phi
and bitwise operations.
2023-07-26 10:16:25 +02:00
Alessandro Di Federico dcc7ca3c6b AdvancedValueInfoMFI: zero-extend constraints
This commit introduces a change in AdvancedValueInfoMFI which forces to
consider constraints valid on 32-bit values to be valid on their
untruncated 64-bit counterparts.

While being unsound, this is important to easily devirtualize indirect
branches on 64-bit architectures where often constraints are expressed
on 32-bit switch values.
2023-07-26 10:16:25 +02:00
Alessandro Di Federico 259d64fc59 MFP::getMaximalFixedPoint: name return result type 2023-07-26 10:16:25 +02:00
Alessandro Di Federico 43baa73149 DOTGraphTraits<MFP::Graph>: improve HTML handling 2023-07-26 10:16:25 +02:00
Alessandro Di Federico ee335eadf1 GraphTraits: improve handling of const MFP::Graph
Improve the handling of const MFP::Graph in GraphTraits and
DOTGraphTraits.
2023-07-26 10:16:25 +02:00
Alessandro Di Federico 537e25e440 TypeShrinking.h: add missing header 2023-07-26 10:16:25 +02:00
Alessandro Di Federico 73a7041396 Introduce GenericGraph::verify 2023-07-26 10:16:25 +02:00
Alessandro Di Federico a552bb1920 ConstantRangeSet: introduce size manipulation API 2023-07-26 10:16:25 +02:00
Alessandro Di Federico 1d53bf4696 Introduce getLLVMIntegerTypeFor 2023-07-26 10:16:25 +02:00
Alessandro Di Federico 22b3da2a02 Remove {DataFlow,ControlFlowEdges}Graph::Base 2023-07-26 10:16:25 +02:00
Pietro Fezzardi 8b2e3a70df ModelTypeNames: annotate stack args with STACK 2023-07-26 10:01:27 +02:00
Pietro Fezzardi 4bbac8220b PTMLCBuilder: improve const-correctness of methods 2023-07-26 10:01:27 +02:00
Djordje Todorovic 262e579128 ModelToHeader: annotation for enum underlying type 2023-07-25 12:03:57 +02:00
Djordje Todorovic 5c0167f792 Add ImportModelFromC Analysis
This analysis will be used for the following features:

1) Edit Type in the Model
2) Edit Function Prototype in the Model
3) Add Type to the Model

It takes C code as an input, parses it and produces a Model
type that represents the C type.
2023-07-24 11:51:47 +02:00
Djordje Todorovic 60ebfa950d VerifyHelper: Remember the reason of fail
In some cases we want to know what was the reason of some error
without crashing the revng.
2023-07-24 09:22:07 +02:00
Djordje Todorovic 0e176f3147 Support for uint64_t in pipeline analyses options 2023-07-24 09:22:07 +02:00
Djordje Todorovic e6b128c17b ModelToHeader: Print annotation __attributes__
This will be useful for `edit/add type` feature,
since we will be able to specify which ABI describes
a function, from the source code written in C.
2023-07-24 09:17:08 +02:00
Ivan Krysak ed4efb0bd9 yield::ptml: add functionComment function 2023-07-21 17:25:24 +02:00
Ivan Krysak 18204ccb9f yield::ptml: add comment function
This is a generic way to format an arbitrary type with `Comment`
field as a comment and emit it using PTML.
2023-07-21 17:25:24 +02:00
Ivan Krysak 4654e4ef74 Ranks: introduce ranks for function arguments 2023-07-21 17:25:24 +02:00
Ivan Krysak 888b083248 Model: introduce edit path helpers for comments 2023-07-21 17:25:24 +02:00
Ivan Krysak 5c31405e63 Model: rework edit path helpers from the ground up 2023-07-21 17:25:24 +02:00
Ivan Krysak 0c8a5aaffb Model: move edit path helpers in from PTML 2023-07-21 17:25:24 +02:00
Ivan Krysak 8fb21693cc CompileTime: improve documentation 2023-07-21 17:25:24 +02:00
Ivan Krysak a012c752e2 CompileTime: introduce selection helper template 2023-07-21 17:25:24 +02:00
Ivan Krysak b2506d8f4b STLExtras: separate compile time helpers 2023-07-21 17:25:24 +02:00
Ivan Krysak 70a5c8edd0 Model: make metadata utilities more generic 2023-07-21 17:25:24 +02:00
Ivan Krysak 560ed4f55e Model: add ReturnValueComment field to functions 2023-07-21 17:25:24 +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 1e9e38548d Model: make register name check stricter 2023-07-21 17:25:24 +02:00
Ivan Krysak bc0eebaad1 Model: enforce consistent name fields 2023-07-21 17:25:24 +02:00
Ivan Krysak 4a32781868 Backend: emit function comment 2023-07-21 04:58:51 +00:00