From 5ccef726c0954116f8f4b5d6347e0acdbb0b6ce3 Mon Sep 17 00:00:00 2001 From: Brandon Miller Date: Tue, 27 Jan 2026 11:26:57 -0500 Subject: Perform function lifting and inlining in arch plugins This change allows architecture plugins to override the LiftFunction callback to iterate a function's basic block list and lift entire functions at once. This is required for architectures such as TMS320 C6x, which have non-traditional "delay slots" in that branches, loads, and other instructions take multiple cycles to complete, and branch instructions can reside within the delay slots of other branches. --- lowlevelil.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lowlevelil.cpp') diff --git a/lowlevelil.cpp b/lowlevelil.cpp index 514595bb..cc1cb6d0 100644 --- a/lowlevelil.cpp +++ b/lowlevelil.cpp @@ -97,6 +97,12 @@ void LowLevelILFunction::SetCurrentAddress(Architecture* arch, uint64_t addr) } +void LowLevelILFunction::SetCurrentSourceBlock(BasicBlock* source) +{ + BNLowLevelILSetCurrentSourceBlock(m_object, source->GetObject()); +} + + size_t LowLevelILFunction::GetInstructionStart(Architecture* arch, uint64_t addr) { return BNLowLevelILGetInstructionStart(m_object, arch ? arch->GetObject() : nullptr, addr); @@ -145,6 +151,12 @@ void LowLevelILFunction::SetIndirectBranches(const vector& branches } +bool LowLevelILFunction::HasIndirectBranches() const +{ + return BNLowLevelILFunctionHasIndirectBranches(m_object); +} + + std::vector LowLevelILFunction::GetRegisters() { std::vector result; -- cgit v1.3.1