Alessandro Di Federico
1c2527f6fa
mv tools/{revng-,}lift
2022-01-31 16:37:22 +01:00
Alessandro Di Federico
a353e00ac1
Introduce model passes
2022-01-31 16:28:14 +01:00
Alessandro Di Federico
3980ee3fad
Introduce model tools
2022-01-31 16:28:14 +01:00
Alessandro Di Federico
cfb47157b9
clang-tidy: readability-identifier-naming
...
This commit fixes all the non-compliance with our preliminary clang-tidy
configuration, which will be merged soon.
2022-01-07 09:18:05 +01:00
Alessandro Di Federico
8c0b918ace
s/DebugHelper.*/IRAnnotators.*/
2021-12-22 17:47:54 +01:00
Alessandro Di Federico
e7bc0c739b
Restore emission of annotated IR
2021-12-22 17:47:54 +01:00
Alessandro Di Federico
6073133545
CodeGenerator: drop IR emission duties
2021-12-22 17:47:54 +01:00
Massimo Fioravanti
9e477d0ada
Make a library out of revng-lift
2021-12-22 13:47:21 +01:00
Alessandro Di Federico
3e1e69e08f
Introduce eraseFromParent
2021-12-17 18:50:08 +01:00
Alessandro Di Federico
1dbe474873
Whitespace fixes
2021-12-16 11:56:06 +01:00
Antonio Frighetto
10f45c593a
Move StackAnalysis to EarlyFunctionAnalysis
2021-12-15 18:03:30 +01:00
Antonio Frighetto
215dab9dd2
Introduce CSVAliasAnalysisPass
...
A pass that decorates memory accesses with
information about CSV aliasing.
2021-12-15 18:03:30 +01:00
Antonio Frighetto
4504b3d770
JumpTargetManager: move getOption in IRHelpers
2021-12-15 18:03:30 +01:00
Antonio Frighetto
34580789eb
BinaryFile: add architecture-dependent fields
...
Add return address register and minimal final stack offset in Arch.
2021-12-15 18:03:30 +01:00
Antonio Frighetto
31620e4efd
CodeGenerator: record static functions as well
2021-12-15 18:03:30 +01:00
Antonio Frighetto
adcda3532b
AVI: fix error in detection of stores to PC
2021-11-18 15:30:07 +01:00
Alessandro Di Federico
89532890ed
Introduce support for importing DWARF information
2021-10-21 15:01:20 +02:00
Alessandro Di Federico
3a3eea0cf5
Introduce support for dynamic functions
2021-10-21 15:01:19 +02:00
Alessandro Di Federico
a023bfa7f5
Introduce ABI handling
2021-10-18 20:44:58 +02:00
Alessandro Di Federico
18cfbdbfe0
Whitespace and other minor changes
2021-10-18 12:39:21 +02:00
Pietro Fezzardi
67eaaab045
JumpTargetManager: enable InstCombine(true)
...
This fixes the latest failing tests after upgrading to llvm-12.
2021-06-14 23:04:02 +02:00
Pietro Fezzardi
b96fbd091d
Fix check-conventions with clang-format-12
2021-06-14 23:04:02 +02:00
Pietro Fezzardi
6f7de910a6
Enable warning -Wunused-local-typedefs
2021-06-14 23:04:02 +02:00
Pietro Fezzardi
544b553e5c
JumpTargetManger: swap constprop with instsimplify
...
Constant propagation has been dropped from llvm
2021-06-14 23:04:02 +02:00
Pietro Fezzardi
12364e6d63
Update BinaryFile to new llvm::object APIs
...
This is required to compile against llvm-12
2021-06-14 23:04:02 +02:00
Pietro Fezzardi
d3d4e1ea5e
JumpTargetManager.cpp: include missing header
...
Before the addition of this include, the file failed to compile with
llvm-12.
2021-06-14 23:04:02 +02:00
Filippo Cremonese
478baf1f43
Fix use-after-free in InstructionTranslator
2021-06-09 18:42:56 +02:00
Antonio Frighetto
67b6bc491b
BinaryFile: always relocate addresses
...
Always relocating addresses allows to include symbols on
dynamically linked position independent objects as well.
2021-06-09 18:15:16 +02:00
Ivan Krysak
bc8c8f82d2
Prevent separation of 'main' headers into group 0
...
The prevention mechanism uses a dummy suffix:
'_THIS_SEQUENCE_IS_NEVER_GOING_TO_HAPPEN'.
2021-06-09 18:05:20 +02:00
Alessandro Di Federico
0af0fea277
Handle R_386_32 relocations
2021-05-12 18:42:17 +02:00
Alessandro Di Federico
ec0a1c7d3e
Fix dispatcher.external
...
`dispatcher.external` used to jump to itself due to a misuse of
`replaceAllUsesWith`.
2021-05-12 18:42:08 +02:00
Alessandro Di Federico
9be97248ce
Reorganize VariableManager
...
This commit slightly improves VariableManager's API and, most
importantly, undef-initializes all TCG variables in order to avoid
creation of complex PHIs.
2021-05-08 19:27:57 +02:00
Alessandro Di Federico
82260c2693
Make dumping assembly and PTC optional
...
Output files can become *very* large.
This commit disables by default dumping disassembled instructions and
PTC code into the IR.
2021-05-08 19:27:57 +02:00
Alessandro Di Federico
91991bb694
Handle PHIs in lifted code
...
In large binaries PHI nodes show up. As a consequence, calls to `newpc`
are no longer the first instruction.
This commit uses the `getFirstNonPHI` method to fix this issue.
2021-05-08 19:19:41 +02:00
Pietro Fezzardi
223d022968
replaceFunction: preserve metadata
2021-04-30 14:52:25 +02:00
Alessandro Di Federico
2e9c2ee275
Introduce FunctionTags
...
FunctionTags goal is to solve the long-standing problem of identifying
what type of function are we dealing with. Is it a lifted function? An
helper?
Now we have a sane way to determine this using Metadata and a proper
API.
2021-04-22 18:07:24 +02:00
Alessandro Di Federico
2ea5723a53
s/getCalledValue/getCalledOperand/g
2021-04-22 18:06:27 +02:00
Alessandro Di Federico
aeb81c4218
Don't implicitly use StringRef as std::string
2021-04-22 18:06:27 +02:00
Alessandro Di Federico
d6df9b682f
Use MaybeAlign
2021-04-22 18:06:27 +02:00
Alessandro Di Federico
bd3e048647
CPUStateAccessFixer: do not call delete directly
2021-04-22 18:06:27 +02:00
Alessandro Di Federico
e92cbd91a1
LoadInst::LoadInst: pass pointee type
2021-04-22 18:06:27 +02:00
Alessandro Di Federico
93ef716311
Module::getFunction returns Function *
2021-04-22 18:06:27 +02:00
Alessandro Di Federico
fee270b64e
Minor changes
2021-04-22 18:06:27 +02:00
Alessandro Di Federico
3ce9acf198
AVI: ignore function calls
...
This commit further reduces the time spent in AVI by considering all the
function calls as indirect. In fact, we currently don't handle indirect
jumps whose target is affected by computation happening before a
function call.
2021-04-22 18:05:39 +02:00
Alessandro Di Federico
33fbcd7ac2
AVI: stop backward exploration at dispatcher
...
This commit greatly improves the performance by ensuring that, when
computing the set of nodes we want to consider for AVI, we do not
traverse the dispatcher.
Doing so, means including *a lot* of irrelevant nodes and wasting a lot
of computation, since the CFG usually is not influenced by stuff
happening before an indirect jump.
In at least a situation the speedup is in the order of 20x, however this
depends on the size of the binary, since traversing the dispatcher means
including all the binary in the computations (as opposed to just the set
of blocks involved in the dataflow to compute a certain expression).
2021-04-22 18:05:39 +02:00
Alessandro Di Federico
0e21755eb0
Handle more count-leading-zeros helpers
2021-04-22 18:03:53 +02:00
Alessandro Di Federico
02f3bb4f88
QEMU helpers no longer have optnone
...
QEMU helpers are compiled with -O0. This led the functions in the QEMU
helper module to have the `optnone` attribute, preventing any
optimization.
This has now been fixed on the QEMU side with the following flags:
clang -Xclang -disable-O0-optnone
2021-04-22 18:03:53 +02:00
Alessandro Di Federico
081809ec38
Adopt EliminateUnreachableBlocks
2021-04-22 14:45:52 +02:00
Alessandro Di Federico
b25c43705c
SerializeModelPass: support new pass manager
2021-03-16 11:55:58 +01:00
Alessandro Di Federico
ae0a92d7e1
SymbolType::fromELF: do not abort
2021-03-16 11:36:32 +01:00