Commit Graph

713 Commits

Author SHA1 Message Date
Alessandro Di Federico b87641b2fe tmp 2023-01-17 12:17:52 +01:00
Alessandro Di Federico 3dee046e09 tmp 2023-01-05 17:49:43 +01:00
Alessandro Di Federico f4b37cdfa2 tmp 2023-01-05 17:49:43 +01:00
Alessandro Di Federico fedfe6f1cb Fix unit tests 2023-01-05 17:49:43 +01:00
Alessandro Di Federico 3993a20e30 tmp 2023-01-05 17:49:42 +01:00
Alessandro Di Federico 51a605c8a8 tmp 2023-01-05 17:49:42 +01:00
Alessandro Di Federico 9b79518770 Drop PrimitiveType.h 2023-01-05 17:49:42 +01:00
Alessandro Di Federico 210e80f2ce [TEMP] Disable tests 2023-01-05 17:49:42 +01:00
Alessandro Di Federico c6630a2414 eraseIfNoUse: check if WeakVH is dead 2023-01-03 20:51:45 +01:00
Alessandro Di Federico a4f4906ba7 Lift: re-enable InstCombine upon harvesting
InstCombine was disabled in favor of some more basic constant
propagation, but it turns that under certain circumstances this leads to
direct branches appearing as indirect branches until we run InstCombine
during finalization, which triggers an assertion, since we do not expect
any direct jump there.

If this, affects translation performance, we can think to run it less
often.
2023-01-03 13:41:40 +01:00
Alessandro Di Federico 8030f1c909 finalizeNewPCMarkers: do not copy attributes 2023-01-03 13:41:40 +01:00
Alessandro Di Federico dd5914ce61 ProgramCounterHandler: initialize field
The uninitialized field led to SIGSEGVs.
2023-01-02 14:22:56 +01:00
Alessandro Di Federico 991980806e LinkForTranslation: use -l:ld-linux-x86-64.so.2 2023-01-02 10:46:13 +01:00
Djordje Todorovic 74c840a9f5 DwarfImporter: set prototype only if available 2022-12-13 11:27:23 +01:00
Djordje Todorovic 8976ab4126 DwarfImporter: handle DW_AT_noreturn 2022-12-13 11:27:16 +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
Djordje Todorovic cad68a9876 Instroduce LDDTree 2022-12-13 11:26:25 +01:00
Massimo Fioravanti 742e1a0c56 TupleTree: switch from public fields to accessors 2022-12-12 18:36:57 +01:00
Massimo Fioravanti 0d3133cfc9 Fix missing includes
This ensures headers make sense on their own, without implicit
assumption about includers to also include other headers before them.
2022-12-09 18:09:39 +01:00
Alessandro Di Federico 0245bf81d7 stringAsPath: externalize 2022-12-09 10:11:27 +01:00
Alessandro Di Federico 974dd0c680 yield::Function: do not use efa::BasicBlock
This change introduces some duplication but ensures an important
property of `tuple_tree_generate`d: data structures: all the leaves are
scalars. Previously, yield::Function was using efa::BasicBlock, making
things more difficult under certain conditions.
Specifically, we can rely on the fact that, when generating a visit to
the TupleTree, we know everything about all non-scalars.
2022-12-09 10:11:27 +01:00
Alessandro Di Federico 93872783f7 yield::ControlFlowGraph: use ROOT_TYPE 2022-12-09 10:11:27 +01:00
Alessandro Di Federico 66b12ad540 Yield: move CrossRelation into its own directory
Also, use ROOT_TYPE.
2022-12-09 10:11:27 +01:00
Alessandro Di Federico 63e3330bab efa::FunctionMetadata: use ROOT_TYPE 2022-12-09 09:12:28 +01:00
Alessandro Di Federico 693b361e4a TupleTree: externalize several methods 2022-12-09 09:08:40 +01:00
Alessandro Di Federico 3a7b78584f Externalize cl::opt generations in Debug.h
These have a significant impact on build times.
2022-12-09 09:07:59 +01:00
Alessandro Di Federico de976fab13 Externalize ModelWrapper::get*Model 2022-12-09 09:07:16 +01:00
Alessandro Di Federico e9db913291 Disassembler: fix iterator invalidation issue
The index of an element of a `SortedVector<yield::Tag>` was saved, but
`SortedVector` behaves like a set.
The issue has been fixed by creating a temporary `Tag` instead of trying
to keep a reference to an existing one.
2022-12-09 09:00:20 +01:00
Alessandro Di Federico 446db0b62c Model type purge: do not purge primitives 2022-11-30 15:06:54 +01:00
Massimo Fioravanti 452d10950e Pipeline: only remove targets in the container
This commit ensures that only content that is actually inside a
container is elegible to be removed.
2022-11-30 15:06:54 +01:00
Pietro Fezzardi e62aa0166e FunctionType::Layout: introduce argument kind
This commit introduces a `Kind` for arguments described in
`FunctionType::Layout`. We nowe basically have three types of arguments:

* Scalar: a regular scarlar argument;
* ReferenceToAggregate: a reference to an aggregete argument on the
  stack;
* ShadowPointerToAggregateReturnValue: a pointer to the storage for the
  (aggregate) return value allocated by the caller;
2022-11-30 15:06:54 +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
Alessandro Di Federico 580ac34bf8 DwarfImporter: set Architecture if Invalid 2022-11-30 15:06:54 +01:00
Ivan Krysak e49f397d13 Layout: work around vector return value problems 2022-11-30 15:06:54 +01:00
Ivan Krysak 855999f5f0 Layout: add support for multiple return values 2022-11-30 15:06:54 +01:00
Ivan Krysak 535c9dd346 ABI: remove MinimumStackArgumentSize value
The architecture-specific pointer (generic register) size is used
instead.

For all the ABIs we support the value of this parameter was already
set to its pointer size. We might need to reintroduce the parameter
in the future if we want to support a super-exotic ABI with different
stack alignment requirements, but that seems highly unlikely.

This also introduces the argument extension helper for one stop all
treating small arguments when they are put into a register or pushed
into the stack.
2022-11-30 15:06:54 +01:00
Ivan Krysak 207668070a QualifiedType: add argument-less isPrimitive() 2022-11-30 15:06:54 +01:00
Alessandro Di Federico 85b7cf2b85 DetectABI: do not analyze functions with prototype 2022-11-30 15:06:54 +01:00
Alessandro Di Federico b83edd61c0 DwarfImport: fix handling of local functions 2022-11-30 15:06:54 +01:00
Alessandro Di Federico 98bea7dcec Minor changes 2022-11-30 15:06:54 +01:00
Massimo Fioravanti 044071435e Fix handling of binaries with no functions
Fix various edge cases when a binary with no functions was analyzed.
2022-11-22 16:19:28 +01:00
Alessandro Di Federico 009c0c2434 flake8: disable R505 (else after return statement) 2022-11-22 15:10:52 +01:00
Massimo Fioravanti 0bfb73fe95 FunctionMetadata: introduce cache
FunctionMetadata was being deserialized every time they were
inspected. This commit introduces a cache structure to prevent this
excessive deserializations.
2022-11-22 14:15:00 +01:00
Pietro Fezzardi fd0914b460 QualifiedType: add isConst method 2022-11-22 10:12:31 +01:00
Giacomo Vercesi 7526d72492 Kinds: exposed locations produced
Expose the locations that can be found in each kind
2022-11-11 13:43:55 +01:00
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 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