Commit Graph

6113 Commits

Author SHA1 Message Date
Alessandro Di Federico f6ad90cfd5 WeightTraits<llvm::BasicBlock *>: fix mistake
We were always returning the same value instead of the computed weight.
2023-04-14 14:54:14 +02:00
Alessandro Di Federico 6b7a62fff8 AddAssignmentMarkersPass::run*: fix return value 2023-04-14 14:54:14 +02:00
Alessandro Di Federico 7291314505 Stop using getPointer
After introduction of opaque pointers, it's not very effective.
2023-04-14 14:54:14 +02:00
Alessandro Di Federico 017aa6a47f Drop CallToLifted
We no longer have such tag, we now inspect the callee using
`isCallToIsolatedFunction`.
2023-04-14 14:54:14 +02:00
Alessandro Di Federico 4c469e5180 Adopt getCallToTagged
`isCallToTagged` used to return a pointer in case of success.
We now have `getCallToTagged` for that.

Also, these functions have been moved to revng.
2023-04-14 14:54:14 +02:00
Alessandro Di Federico ead746ba68 Adopt MemoryEffects
Switch from function attributes to MemoryEffects.
2023-04-14 14:54:14 +02:00
Alessandro Di Federico 50838957f4 Adopt new isSafeToExpandAt usage 2023-04-14 14:54:14 +02:00
Alessandro Di Federico f86ca062b4 DLA: handle scSequentialUMinExpr 2023-04-14 14:54:14 +02:00
Alessandro Di Federico 4a3b75757d s/zextOrSelf/zext/g 2023-04-14 14:54:14 +02:00
Alessandro Di Federico 887009a14b InaccessibleMemOnly: adopt MemoryEffects 2023-04-14 14:54:14 +02:00
Alessandro Di Federico 340f64e150 Drop usages of PointerType::getElementType 2023-04-14 14:54:14 +02:00
Alessandro Di Federico 21bbd8b414 Drop usages of Type::getPointerElementType 2023-04-14 14:54:14 +02:00
Alessandro Di Federico c56b250c99 RegionCFGTree: add missing const 2023-04-14 14:54:14 +02:00
Alessandro Di Federico 95615cf400 Adopt new APInt::toString signature 2023-04-14 14:54:14 +02:00
Alessandro Di Federico cad027abb2 Add missing includes 2023-04-14 14:54:14 +02:00
Alessandro Di Federico e2ee3f5495 Switch from llvm::Optional to std::optional 2023-04-14 14:54:14 +02:00
Alessandro Di Federico 0e5863e2e4 Make CreateLoad usages opaque pointers-compatible 2023-04-14 14:54:14 +02:00
Alessandro Di Federico b9dcb977bd Adopt CallBase::arg_size 2023-04-14 14:54:14 +02:00
Alessandro Di Federico dd383076ab Drop arg_operands in favor of args 2023-04-14 14:54:14 +02:00
Alessandro Di Federico ab089a6d3a Adopt clang-format 16 2023-04-14 14:54:14 +02:00
Alessandro Di Federico 8fd34ff0f7 pruneDICompileUnits: delegate to DIFinder 2023-04-14 08:36:05 +02:00
Alessandro Di Federico 5b8d5a8a41 Introduce OpaqueFunctionsPool::initializeFromName 2023-04-14 08:36:05 +02:00
Alessandro Di Federico 416c59c43b support.py: rework get_command
We introduce two paths where we can hard code search prefixes
(`/additional-search-prefixes`) and additional binaries paths
(`/share/revng/additional-bin-paths`).

This enables us to add to `additional-bin-paths` the configure-time
specified path of the preferred LLVM installation, instead of relying on
`PATH` to look up, e.g., `opt` at run-time.
2023-04-13 18:11:48 +02:00
Alessandro Di Federico 40135aad97 Drop CSVAliasAnalysisPass 2023-04-13 18:11:48 +02:00
Alessandro Di Federico 8ef567471b LLVMContainer::mergeBackImpl: postpone verify
This commit moves module verification after cleanup.
2023-04-13 18:11:48 +02:00
Alessandro Di Federico 060d26f212 Introduce getLocation(Instruction *) 2023-04-13 18:11:48 +02:00
Alessandro Di Federico 8c5f6628d1 Stop considering Instructions Taggable
Adding custom (i.e., non-dbg) metadata to Instructions has proven to be
too brittle.
2023-04-13 18:11:48 +02:00
Alessandro Di Federico bce3555285 Drop CallToLifted tag
This commit drops the `CallToLifted` tag in favor of a
`getCallToIsolatedFunction` function which checks if the call has the
`IsolatedFunction` tag. The function also assumes that indirect calls
are calls to lifted functions.
2023-04-13 18:11:48 +02:00
Alessandro Di Federico 6e0fc63b77 Reschedule AttachDebugInfo after InlineHelpers 2023-04-13 18:11:48 +02:00
Alessandro Di Federico 624cf2f160 AVI: add GVN
We should be able to drop this soon.
2023-04-13 18:11:48 +02:00
Alessandro Di Federico b5607efce0 struct_initializer: mark as pure 2023-04-13 18:11:48 +02:00
Alessandro Di Federico 98b92a5b01 Prevent merging calls to isolated functions
SimplifyCFG with instruction sinking enabled sometimes can merge two
call sites that are identical at LLVM IR level, but originally come from
two distinct addresses in the original binary.

The nomerge attribute prevents this type of problematic deduplication.
2023-04-13 18:11:48 +02:00
Alessandro Di Federico 79d9011b95 InlineHelpers: drop !dbg post-inlining 2023-04-13 18:11:48 +02:00
Alessandro Di Federico 401f731eda AttachDebugInfo: color instructions with a visit
We used to only color instructions in the same BasicBlock as the call to
`newpc`.  However, an instruction in the original binary can span
multiple BasicBlocks.
2023-04-13 18:11:48 +02:00
Pietro Fezzardi 96390027b7 MakeModelGEPPass.cpp: fix outOfBound in lowerBound 2023-04-11 15:54:20 +02:00
Alessandro Di Federico 92b9ba5571 Import findPhiTreeLeaves 2023-04-08 08:42:24 +02:00
Alessandro Di Federico dc7f731bef Mark build_PlainMetaAddress as const 2023-04-08 08:42:24 +02:00
Alessandro Di Federico 995d44cf73 Implement Location::{parent,back} 2023-04-08 08:42:24 +02:00
Alessandro Di Federico 52ee85f55f Implement efa::BasicBlock::contains 2023-04-08 08:42:24 +02:00
Alessandro Di Federico 0c991af685 AVI: after function_call, jump to anypc
We used to jump to the dispatcher, however we only sink to an
unreachable `anypc`. We were threfore significantly complicating the CFG
in case of indirect function calls.
2023-04-08 08:42:24 +02:00
Alessandro Di Federico f313a72453 DropHelperCalls: pass in loaded CSVs, not pointers
We used to pass pointers to helper functions, but we just need to pass
the loaded value: no need to leak the pointer to the CSV.
2023-04-08 08:42:24 +02:00
Alessandro Di Federico 19d59ffd73 Implement Segment::dump 2023-04-08 08:42:24 +02:00
Alessandro Di Federico 6564fc0568 Minor changes 2023-04-08 08:42:24 +02:00
Alessandro Di Federico cdf1654f36 CSAA: do not use ptr, use pointee type 2023-04-08 08:42:24 +02:00
Alessandro Di Federico bc4833078c Fix InstCombine constructor invocation
In LLVM 12 the `InstCombine` constructor used to take a `bool`, in LLVM
16 it takes an integer. Implicit promotion was hiding this fact.
2023-04-08 08:42:24 +02:00
Alessandro Di Federico 1fa34fff9e revng opt: force legacy pass manager 2023-04-08 08:42:24 +02:00
Alessandro Di Federico e73543e430 AsmCall: add parameter attribute for element type
Fix calls to inline assembly
2023-04-08 08:42:24 +02:00
Alessandro Di Federico a0c0cd9468 extractFromConstantStringPtr: no stripPointerCasts 2023-04-08 08:42:24 +02:00
Alessandro Di Federico f7f47ceac6 VariableManager: drop autodetection of ${ARCH}CPU 2023-04-08 08:42:24 +02:00
Alessandro Di Federico 71f754f811 PDBImporter: declare our own FilterOptions 2023-04-08 08:42:24 +02:00