Commit Graph

3168 Commits

Author SHA1 Message Date
Giacomo Vercesi d185fc80ac Rank: fix RankConvertibleTo with RootRank
RankConvertibleTo would be erroneously fail when used with a RootRank
either in the From or To template parameter.
2022-11-11 13:43:55 +01:00
Massimo Fioravanti fa30486ce0 Outliner: create extractor cache once 2022-11-10 19:41:42 +01:00
Giacomo Vercesi e516d245c3 ModelToHeader: model functions are referenced
Change the output of ModelToHeader in regards to model functions: they
are referenced there while defined in the function-specific decompiled C
code
2022-11-10 17:27:53 +01:00
Pietro Fezzardi 4b4531027b DecompileFunction.cpp: support PoisonValue 2022-11-10 13:05:51 +01:00
Pietro Fezzardi 8497ab4b88 MakeModelGEP: don't crash on undef and poison 2022-11-10 13:05:51 +01:00
Pietro Fezzardi 38cb917b87 Revive RemoveLLVMAssumeCallsPass
This pass remove calls to `llvm.assume` which are introduced by stack
promotion for stack alignment.
2022-11-10 12:07:37 +01:00
Pietro Fezzardi 70a6185ce8 DLA/Frontend: don't skip calls with 0 uses
Before this commit we were not adding nodes to DLATypeSystem for calls
with 0 uses.

This commit fixes the problem, and only avoids adding nodes for calls
that return void.
2022-11-09 16:23:34 +01:00
Pietro Fezzardi 0f8c07e71a DecompileFunction.cpp: fix typedef traversal
Before this commit, to emit field member accesses and array accesses in
C we performed a broken traversal of typedefs.
It was buggy since its inception but it was never triggered because no
typedefs actually reached this point.

This commit fixes that using the reworked peelConstAndTypedefs
machinery.
2022-11-09 12:02:26 +01:00
Pietro Fezzardi 0097af6dd0 Fix peelConstAndTypedefs for model::TypedefType
Before this commit typedefs were not unwrapped correctly, leading to
infinite loops.
2022-11-09 11:59:51 +01:00
Pietro Fezzardi eef93f2a85 InitModelTypes: handle CABIFunctionType
Before this commit, the code assumed that whenever we had multiple
return types on the model we had an aggregate return type also in LLVM
IR. This is not true anymore with CABIFunctionType, where many model
types can be stuffed into a single wide integer in LLVM IR.

This commit fixes the code to be able to handle that situation.
2022-11-09 11:59:51 +01:00
Pietro Fezzardi 35b8d1b298 MakeModelGEP: avoid crash on function pointers 2022-11-08 14:09:07 +01:00
Pietro Fezzardi 9440aa434d DLA: pointer edges only for pointer-sized nodes
Before this commit, the creation of intra-procedural types and edges
was too liberal, possibly leading to creation of pointer edges starting
from nodes that were not pointer-sized.

This commit fixes the issue, never creating outgoing pointer edges from
non-pointer-sized nodes.
2022-11-08 11:47:50 +01:00
Antonio Frighetto 9aa9007f18 DLA/Backend: do not add new overlapping fields
Make sure we do not introduce new fields that overlap the
original ones, should they exist.
2022-11-03 14:47:47 +01:00
Pietro Fezzardi 994280ba34 DLA: fix slack in CompactCompatibleArrays
Before this commit, a logic mistake made the AvailableSlack too large
for arrays that started near the beginning of their parent.
This in turn allowed a compacted array to "underflow" on lower addresses
w.r.t. the parent.

This commit fixes the problem by properly computing the AvailableSlack,
restraining it in cases where the array under analysis is close to the
beginning of the parent.
2022-11-03 13:23:59 +01:00
Giacomo Vercesi dad9dbcec8 getCurrentRoot: improve /proc/self/maps parsing
This fixes a behavior in getCurrentRoot that would lead it to reporting
an incorrect path if revng was installed in a path with spaces.
2022-11-02 11:50:40 +01:00
Giacomo Vercesi 4ae8df0ad2 Yield disassembler: drop support for AMDGPU 2022-11-02 11:50:40 +01:00
Pietro Fezzardi 2c228a52d5 DLA: avoid copies in SimplifyInstanceAtOffset0
This commits starts using llvm::df_iterator explicitly, and to use its
skipChildren method to prevent unnecessary copies and speed up the
algorithm.
2022-11-02 08:14:59 +01:00
Massimo Fioravanti 10ab39664d Runner: postpone logging after checks 2022-10-31 16:47:33 +01:00
Pietro Fezzardi 73210ab4ae Adopt TupleTreeReference caching 2022-10-31 09:08:17 +01:00
Giacomo Vercesi 0b80801b2b TupleTreeDiff: applyDiff uses ErrorList
Change how TupleTreeDiff and Visitor work so they can populate an
ErrorList in case the deserialization/apply of a diff fails.
2022-10-30 09:13:44 +01:00
Giacomo Vercesi a75fc40abe PipelineC: drop rp_manager_create_memory_only
The function was unused, broken and superseded by the other
rp_manager_create with `execution_directory=nullptr`.
2022-10-30 09:13:23 +01:00
Giacomo Vercesi 81d25f9805 PipelineC: expose invalidation logic 2022-10-30 09:13:14 +01:00
Alessandro Di Federico 53616b34ea LinkForTranslation: use ld, not c++
This change enables us to depend on the linker only, not on the
compiler.
2022-10-29 12:11:17 +02:00
Djordje Todorovic ee8eb9e697 Adding LoopRewriteWithCanonicalIV LoopPass 2022-10-21 15:56:13 +02:00
Pietro Fezzardi bf83f40e3b Move SCEVBaseAddressExplorer.h from public headers 2022-10-21 10:00:23 +02:00
Pietro Fezzardi 25119c4377 Drop bugged addPointerQualifier for getPointerTo
This commit removes the bugged addPointerQualifier helper function,
that was wrongly pushing the pointer qualifier at the end.

Instead, we now use the correct model::Binary::getPointerTo method.
2022-10-21 09:45:28 +02:00
Massimo Fioravanti 5d730d1411 Upgrade to support starless revng 2022-10-20 16:06:13 +02:00
Massimo Fioravanti d55aa9b9e6 Pipeline: remove * from targets
Now * is just a pipeline frontend shorthand.
2022-10-20 14:20:12 +02:00
Pietro Fezzardi 887701e6f0 InitModelTypes: better support CABIFunctionType 2022-10-20 10:22:20 +02:00
Pietro Fezzardi 4df861a099 MakeModeGEPPass: fix makeBestGEPArgs for arrays 2022-10-18 17:05:50 +02:00
Pietro Fezzardi 46f54c4065 MakeModelGEPPass: std::move pickBestTAP results 2022-10-18 17:05:50 +02:00
Pietro Fezzardi 83737745af MakeModelGEPPass: fix ChildInfo dump() method 2022-10-18 17:05:46 +02:00
Pietro Fezzardi 2d1ade06b3 Support pointers to arrays in getNamedCInstance 2022-10-17 11:25:24 +02:00
Pietro Fezzardi 9589ba6962 Drop unused variable from getDependencyForFullType 2022-10-12 08:21:28 +02:00
Pietro Fezzardi 7583537848 DependencyGraph.cpp: fix typo in comments 2022-10-12 08:21:13 +02:00
Alessandro Di Federico 5a99154196 Put Python packages into lib/python*/site-packages 2022-10-11 19:08:10 +02:00
Giacomo Vercesi eb2148e157 Add Location info for PrimitiveTypes 2022-10-11 17:36:29 +02:00
Giacomo Vercesi 72050274e2 getNamedCInstance: drop declaration parameter
In all cases this is false
2022-10-11 17:36:29 +02:00
Giacomo Vercesi e53033d0b8 Ranks: remove use of TypeField in locations
Use the new Ranks made available by revng
2022-10-11 17:36:29 +02:00
Giacomo Vercesi 025f6d5580 Assembly & CFG: fix MIME type
Change the MIME type of the assembly artifact and the svg graphs to the
new naming convention.
2022-10-11 17:11:04 +02:00
Giacomo Vercesi 0566f5342e Yield/PTML: make instruction definition 0-sized
Instruction definition tags are now generated as a 0-size anchor on
the LHS of the text of the actual instruction, this is to prevent
a potential user asking for the definition/reference of the single
instruction.
2022-10-11 17:10:17 +02:00
Giacomo Vercesi 4d0f72548a ControlFlow/SVG: switch to simple tree layouter 2022-10-11 17:10:06 +02:00
Ivan Krysak b94c23cf52 Yield/ControlFlow: stop accounting for footer 2022-10-11 17:09:39 +02:00
Pietro Fezzardi 8ab42d2899 MakeModeGEP: prevent copy of intermediate results 2022-10-07 18:15:25 +02:00
Pietro Fezzardi 43cb77e6a3 TypeSystemPrinter: route edge to the top of nodes 2022-10-06 17:53:47 +02:00
Giacomo Vercesi d7265ff160 PipelineC: allow signal masking
Some users of PipelineC might be interested in preserving
pre-existing signals, this commits adds this functionality.
2022-10-04 14:13:56 +02:00
Giacomo Vercesi 7fda1ef459 PipelineC: drop AbortHook
Handle crashes via signal handlers. Switch python's revng.api from
a normal python function to faulthandler, which works also in the
case of harsher interruptions (e.g. SIGABRT).
2022-10-04 14:13:56 +02:00
Massimo Fioravanti fd66c32727 Add Container type registry 2022-10-03 14:26:06 +02:00
Massimo Fioravanti f1852166ab Pipeline: reworked cpp container types 2022-10-03 14:26:06 +02:00
Pietro Fezzardi 8d7568710a DLA: add PushDownPointers dla::Step 2022-09-30 18:34:10 +02:00