Commit Graph

987 Commits

Author SHA1 Message Date
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 c3fc2d1f88 TupleTreeDiff deserialization: fix initialization
We used to assign an uninitialized field to `false`. However, what we
really wanted to is to construct the optional by invoking the default
constructor of the `value_type` of the optional.
2022-12-09 09:02:35 +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 98025f4dbe yield::Tag: let TTG emit the key 2022-12-09 08:59:46 +01:00
Alessandro Di Federico c75a3450c1 TupleTree::deserialize: drop useless yaml::Input
This was a leftover from yaml::Input usages centralization.
2022-12-09 08:58:30 +01:00
Alessandro Di Federico 185df966b7 LLVMContainer: s/REVNG/revng./g 2022-11-30 15:06:54 +01:00
Alessandro Di Federico 06d4c3a5ed LLVMContainer: infect DataLayouts upon linking 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
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 afdd3302d8 STLExtras: add constepxr version of find 2022-11-30 15:06:54 +01:00
Ivan Krysak 1f4b5dfd36 Model: associate a primitive kind to each register 2022-11-30 15:06:54 +01:00
Ivan Krysak 207668070a QualifiedType: add argument-less isPrimitive() 2022-11-30 15:06:54 +01:00
Ivan Krysak c3c3ed4381 Move pointer creation away from model::Binary 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
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
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 764c7efbb8 Make isCallTo accept any llvm::Value * 2022-11-22 10:12:34 +01:00
Pietro Fezzardi fd0914b460 QualifiedType: add isConst method 2022-11-22 10:12:31 +01:00
Pietro Fezzardi 4334481894 UpcastablePointer: upcast with mutable callables 2022-11-15 14:15:20 +01:00
Pietro Fezzardi fb7edef129 Add ptml::scopeTag helper function 2022-11-15 14:15:20 +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
Massimo Fioravanti ad0f1163b2 AVI: increase performance by caching successors 2022-11-10 19:40:11 +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 de76a5239b PipelineC: improve documentation 2022-10-30 09:13:29 +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
Pietro Fezzardi f371c03e93 Globals.h: evictCachedReferences on clear() 2022-10-29 16:46:19 +02:00
Pietro Fezzardi d520fd5aea Cache TTRs in Model tools 2022-10-29 16:46:19 +02:00
Pietro Fezzardi fff0fbd874 LoadModelPass: cache TTRs on getReadOnlyModel
The cache is evicted on the next call to getWritableModel.
2022-10-29 16:46:19 +02:00
Pietro Fezzardi f371be4271 Cache TTRs on getModelFromContext
The cache is evicted on getWritableModelFromContext.
2022-10-29 16:46:19 +02:00
Pietro Fezzardi d04e2e73d3 TupleTree: caching methods for TupleTreeReferences 2022-10-29 16:46:19 +02:00
Pietro Fezzardi 0795c7e331 TupleTreeReference: cache target pointers 2022-10-29 16:46:19 +02:00
Pietro Fezzardi 7eb94c6646 QualifiedType: add operator<=> 2022-10-29 16:46:19 +02:00
Pietro Fezzardi cf3103d3d7 TupleTree{Path,Reference}: add operator<=> 2022-10-29 16:46:19 +02:00
Pietro Fezzardi 8e9170eb60 Enforce that TTRs in TupleTree are mutable 2022-10-29 16:46:19 +02:00
Pietro Fezzardi 6173d154a3 TupleTree: visitReferences with non-const visitors 2022-10-29 16:46:19 +02:00
Pietro Fezzardi 5f8dab184d Move ConstOrNot to Concepts.h 2022-10-29 16:46:19 +02:00
Giacomo Vercesi 232a28ae69 FileContainer: handle case where Path is empty
When requesting a `cloneFiltered` the Path attribute of the
FileContainer might be empty, and this will lead to an abort. Fix this
situation by checking if the Path is empty.
2022-10-24 14:25:02 +02:00
Massimo Fioravanti d55aa9b9e6 Pipeline: remove * from targets
Now * is just a pipeline frontend shorthand.
2022-10-20 14:20:12 +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 677fe190be Ranks: split TypeField
Split the TypeField Rank in 3 more specific ranks: StructField,
UnionField and EnumMember.
2022-10-11 17:10:46 +02:00
Ivan Krysak b94c23cf52 Yield/ControlFlow: stop accounting for footer 2022-10-11 17:09:39 +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