Commit Graph

6113 Commits

Author SHA1 Message Date
Pietro Fezzardi acb4b495f7 MakeModelGEPPass: refactor YAML serialization 2022-11-30 18:16:13 +01:00
Pietro Fezzardi d34abf3706 DecompileFunction.cpp: fix ModelGEP traversal
handleSpecialFunction was still traversing Qualifiers in the wrong
order.
2022-11-30 18:16:13 +01:00
Pietro Fezzardi 1bec5bd2ab Define all primitive types in dedicated header
This commit does the following:
- drops revngfloat.h
- disables printing primitive types in ModelToHeader
- creates a new header revng-primitive-types.h which includes all the
  declarations of all revng primitive types
2022-11-30 18:16:13 +01:00
Pietro Fezzardi 7c643f3d1b ModelHelpers: support generic80_t and generic96_t 2022-11-30 18:16:13 +01:00
Pietro Fezzardi e92f6a3ddd ModelHelpers.cpp: refactor handling of ModelGEP 2022-11-30 18:16:13 +01:00
Pietro Fezzardi 2ab5b5d9bf Fix handling of UndefValue and PoisonValue 2022-11-30 18:16:13 +01:00
Ivan Krysak 033ccbe51a Adopt FunctionType::Layout to improve CABI support 2022-11-30 18:16:13 +01:00
Ivan Krysak 654afbef0c Move pointer creation away from model::Binary 2022-11-30 18:16:13 +01:00
Alessandro Di Federico bff488b79e SegregateStackAccessesPass.cpp: drop bogus comment 2022-11-30 18:16:13 +01:00
Alessandro Di Federico a29b931f2a Merge branch 'feature/cabi-prototypes' 2022-11-30 15:09:31 +01:00
Alessandro Di Federico 0ed1c6f9ee daemon-self-test: disable testing
Running `revng daemon-self-test` runs steps and analyses that are part
of downstream projects, leading to unexpected and unstable results.
We can still run this downstream.
We can re-enable this once we can run it on a specific step and with a
custom set of analyses.
2022-11-30 15:06:54 +01:00
Alessandro Di Federico 9470e2582b abi/test.sh: use temporary directory 2022-11-30 15:06:54 +01:00
Alessandro Di Federico 446db0b62c Model type purge: do not purge primitives 2022-11-30 15:06:54 +01:00
Alessandro Di Federico 036963b0b7 Rework tests 2022-11-30 15:06:54 +01:00
Alessandro Di Federico 185df966b7 LLVMContainer: s/REVNG/revng./g 2022-11-30 15:06:54 +01:00
Alessandro Di Federico 762cc63d96 CollectCFG: purge addresses from test ground truth 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
Antonio Frighetto b2d24875e6 override-by-name.py: compare to bytes 2022-11-30 15:06:54 +01:00
Alessandro Di Federico 838d9a5992 revng model override-by-name: fix args doc 2022-11-30 15:06:54 +01:00
Alessandro Di Federico 085f44b0ad tests: adopt temp 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 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 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
Pietro Fezzardi f7f5e5fd28 DLA: fix CompactCompatibleArrays 2022-11-30 11:37:00 +01:00
Pietro Fezzardi 1b05ff38be DLAPass: verify model after updating it 2022-11-30 11:37:00 +01:00
Pietro Fezzardi 1af6c75fc5 DLAUpdateModelTypes.cpp: new assertions & comments 2022-11-30 11:37:00 +01:00
Alessandro Di Federico f5fb269468 check-conventions: use first byte as diff opcode 2022-11-28 09:21:42 +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 a057ce54a7 Avoids missing outputs when empty
FileContainer should not be used when we wish to produce a empty output
file rather than no file at all.
2022-11-22 15:21:03 +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
Massimo Fioravanti 335d402245 Change signatures to forward metadata cache. 2022-11-22 12:27:02 +01:00
Pietro Fezzardi 13127383cf Merge branch 'feature/ptml-c-refactor' 2022-11-22 10:56:34 +01:00
Alessandro Di Federico 517f33e673 Merge branch 'feature/ptml-c-refactor' 2022-11-22 10:37:26 +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 8aaa3ca92e Refactor PTML generation for functions 2022-11-16 16:02:09 +01:00
Pietro Fezzardi e72a578743 Refactor PTML generation for local variables 2022-11-16 11:24:37 +01:00