Commit Graph

6113 Commits

Author SHA1 Message Date
Ivan Krysak 7634b67153 PremutationSelection: introduce a bail condition
This allows algorithm to avoid spinning unnecessary where we choose
an overly-big iteration count.
2024-03-18 11:58:11 +01:00
Ivan Krysak 67c4a65122 Minor improvements 2024-03-18 11:58:11 +01:00
Ivan Krysak 2bffccaaf6 Move ImmediateStyle configuration to the model 2024-03-18 11:58:11 +01:00
Ivan Krysak 184aa03847 Move AddressStyle configuration to the model 2024-03-18 11:58:11 +01:00
Ivan Krysak 2827c9d7f7 Move UseATTSyntax configuration to the model 2024-03-18 11:58:11 +01:00
Ivan Krysak d781f3ae79 Yield: make disassembler config-aware 2024-03-18 07:20:41 +00:00
Ivan Krysak 371784afbd Model: introduce basic disassembly configuration 2024-03-18 07:20:41 +00:00
Ivan Krysak 7403f09b7d docs: add new asm tokens 2024-03-18 07:20:41 +00:00
Ivan Krysak a3e9e689ca cli/ptml: add support for the new asm tokens 2024-03-18 07:20:41 +00:00
Ivan Krysak e1060ed6ed cli/ptml: fix asm.helper support 2024-03-18 07:20:41 +00:00
Ivan Krysak 870efbf201 Yield: introduce a conditional instruction prefix 2024-03-18 07:20:41 +00:00
Ivan Krysak aa44fdbe91 docs: fix some typos 2024-03-18 07:20:41 +00:00
Ivan Krysak a150b49c70 Support: remove unused dumper 2024-03-18 07:20:41 +00:00
Alessandro Di Federico 7623cf6bca Merge branch 'feature/segregation-testing' 2024-03-15 19:05:16 +01:00
Alessandro Di Federico e990d491a4 Merge branch 'feature/segregation-testing' 2024-03-15 19:05:11 +01:00
Ivan Krysak a88b03aef8 Backend: fix an assertion on a lost typedef 2024-03-15 19:05:10 +01:00
Ivan Krysak 08041ba771 ToCFT: fix last stack argument verification
It was still broken, even after `feature/alignment-fixes`, so
this commit softens requirements even further, to allow some of
the desired cases to pass through the verifier.
2024-03-15 19:05:10 +01:00
Ivan Krysak 60cbf9a33f Use ABI test binaries for the entire pipeline 2024-03-15 19:05:10 +01:00
Alessandro Di Federico 250354bd27 ValueMaterializer: work around unreachable blocks 2024-03-15 19:05:10 +01:00
Ivan Krysak a58ccd159e ImportPE: fix the filters 2024-03-15 19:05:10 +01:00
Ivan Krysak 1b52530531 ABI-tests: turn temporary directory into "output" 2024-03-15 19:05:10 +01:00
Ivan Krysak d71fd7a1ad ABI-tests: strip model of irrelevant functions 2024-03-15 19:05:10 +01:00
Ivan Krysak 6feb9aa001 ABI-tests: rename replace-abi script 2024-03-15 19:05:10 +01:00
Ivan Krysak 8ecdd76e68 ABI-tests: improve ABI mismatch error message 2024-03-15 19:05:10 +01:00
Ivan Krysak 5407c11a8f ABI: do not touch ABIs of unrelated functions 2024-03-15 19:05:10 +01:00
Alessandro Di Federico c5650a390b Merge branch 'feature/switch-weaved-tile' 2024-03-15 17:54:55 +01:00
Alessandro Di Federico e93d8ba09f RawBinaryView:getByOffset: fix of by = 2024-03-15 17:13:20 +01:00
Giacomo Vercesi a376c2b36a rcc: improve non-module files detection
Improve the detection of non-module files in `MyPyPass` to avoid python
scripts being erroneously passed to mypy together, causing the error
`Duplicate module named` in mypy.
2024-03-15 15:30:16 +01:00
Andrea Gussoni 55959f3fe5 InlineDispatcherSwitch: simplifySwitchBreak
Implement a new beautify pass which simplifies away `SwitchBreakNode`s
that constitute the entire body of `case`s in `switch`es, that do not,
have a `default` case. In such situations indeed, the semantics is,
preserved by removing the `SwitchBreakNode`s.
2024-03-15 14:50:42 +01:00
Andrea Gussoni a13c7677cf InlineDispatcherSwitch: generic weaved switches
We drop the assumption that each weaved `switch` must be nested inside
its related main `switch`, as a consequence of having generalized the
tiling algorithm in order to be able to emit a weaved `switch` as a AST
successors of the related main `switch`.
2024-03-15 14:27:00 +01:00
Andrea Gussoni 3defc2d431 InlineDispatcherSwitch: remove empty cases
Remove `switch` cases that may be simplified during the
`InlineDispatcherSwitch` beautify.
2024-03-15 14:27:00 +01:00
Andrea Gussoni cf43b9e92d GenerateAst: remove weaved switch handling
Remove the special handling for the weaved `switch`es.
2024-03-15 14:27:00 +01:00
Andrea Gussoni 95f9bb32cb GenerateAst: add SwitchBreakNode::removeDefault 2024-03-15 14:27:00 +01:00
Andrea Gussoni 8fe291a62b GenerateAst: use llvm::find_if and llvm::count 2024-03-15 14:27:00 +01:00
Andrea Gussoni 6c8d963f69 RestructureCFG: Reorganize debug graphs
Various improvements to the debug graphs for `restructure-cfg` and
`beautify`:
- Normalize casing and syntax of debug graphs.
- Improve the graph folders name and layout.
- Implement `CFGDumper` and `ASTDumper` for when we need a serialization
  with incremental indexes.
- Remove old and stale graph serializations.
2024-03-11 19:08:34 +01:00
Andrea Gussoni d863dd1542 RegionCFGTreeImpl: do not reprocess conditionals
Do not re-enqueue conditional nodes a for combing, when duplicating a
conditional.

This can be done in such way, thanks to the property that we process
conditional nodes in postorder. Therefore, if conditional node A causes
the duplication of, say, node B, we have the guarantee that such node B
has already been processed by the combing. Therefore, the clone of node
B, say node B', should not be reprocessed for combing.
2024-03-11 18:51:03 +01:00
Andrea Gussoni 7d8b0139f3 SegregateStack: fix FileCheck directive
Add `%` in order to match precisely the argument LLVMIR value, and not
other spurious characters around.
2024-03-11 18:36:09 +01:00
Alessandro Di Federico 3fb9e58b0a Progress: cap line length to terminal size 2024-03-01 17:47:28 +01:00
Alessandro Di Federico 9c9a47a812 Merge branch 'feature/13-binaries-fixes' 2024-03-01 16:46:30 +01:00
Alessandro Di Federico fcf7fd8a0e Merge branch 'feature/13-binaries-fixes' 2024-03-01 16:45:58 +01:00
Alessandro Di Federico 8939e2ad2a MakeModelGEPPass: do not use trySize 2024-03-01 16:11:28 +01:00
Alessandro Di Federico 308e7eccd9 MakeSegmentRef: limit strings to pointer-sized int 2024-03-01 16:11:28 +01:00
Alessandro Di Federico 75aa28d4b8 Merge branch 'feature/qol-fixes-3' 2024-03-01 16:09:36 +01:00
Giacomo Vercesi f8e50acc49 ImportFromCAnalysis: fix getOptionsfromCFGFile
Rewrite the `getOptionsfromCFGFile` function using llvm facilities.
The new code has the following features.
- It avoids the default behaviour of `std::fstream` of opening the file
in read-write.
- It's stricter should an error occur when opening the file.
2024-03-01 16:07:45 +01:00
Giacomo Vercesi 94904b2ad8 HeaderToModel: output all error lines
Change the behaviour of `HeaderToModelDiagnosticConsumer` to report all
error lines instead of the last one.
2024-03-01 16:07:45 +01:00
Alessandro Di Federico aec4be9b07 AttachDebugInfo: improve docs 2024-03-01 14:53:07 +01:00
Alessandro Di Federico ffe93548c5 Model ::size(): do not suspend tracking 2024-03-01 14:53:07 +01:00
Alessandro Di Federico 7f1a15d1bb Model: ignore empty ExportedNames 2024-03-01 14:53:07 +01:00
Alessandro Di Federico db4e5c4a5e Introduce dumpModel 2024-03-01 14:53:07 +01:00
Alessandro Di Federico c346e60ee7 PromoteOriginalName: no globals with local names
This commit ensures we do not introduce new global symbols that would
make local symbols invalid.
2024-03-01 14:53:06 +01:00