pub struct FunctionDecompilerContext {
pub block_ast_node_stack: HashMap<BasicBlockId, Vec<ExecutionFrame>>,
pub current_block_id: Option<BasicBlockId>,
pub current_region_id: Option<RegionId>,
pub opcode_handlers: HashMap<Opcode, Box<dyn OpcodeHandler>>,
pub ssa_context: SsaContext,
}
Expand description
Manages the state of the decompiler, including per-block AST stacks and current processing context.
Fields§
§block_ast_node_stack: HashMap<BasicBlockId, Vec<ExecutionFrame>>
AST node stacks for each basic block.
current_block_id: Option<BasicBlockId>
The current basic block being processed.
current_region_id: Option<RegionId>
The current region being processed.
opcode_handlers: HashMap<Opcode, Box<dyn OpcodeHandler>>
The handlers for each opcode.
ssa_context: SsaContext
The SSA Context
Implementations§
Source§impl FunctionDecompilerContext
impl FunctionDecompilerContext
Sourcepub fn start_block_processing(
&mut self,
block_id: BasicBlockId,
region_id: RegionId,
) -> Result<(), FunctionDecompilerError>
pub fn start_block_processing( &mut self, block_id: BasicBlockId, region_id: RegionId, ) -> Result<(), FunctionDecompilerError>
Sourcepub fn process_instruction(
&mut self,
instr: &Instruction,
) -> Result<ProcessedInstruction, FunctionDecompilerError>
pub fn process_instruction( &mut self, instr: &Instruction, ) -> Result<ProcessedInstruction, FunctionDecompilerError>
Sourcepub fn get_stack(&self, block_id: &BasicBlockId) -> Option<&Vec<ExecutionFrame>>
pub fn get_stack(&self, block_id: &BasicBlockId) -> Option<&Vec<ExecutionFrame>>
Retrieves the AST stack for a basic block.
Sourcepub fn pop_one_node(&mut self) -> Result<AstKind, FunctionDecompilerError>
pub fn pop_one_node(&mut self) -> Result<AstKind, FunctionDecompilerError>
Pops an AST node from the current basic block’s stack.
Sourcepub fn pop_expression(&mut self) -> Result<ExprKind, FunctionDecompilerError>
pub fn pop_expression(&mut self) -> Result<ExprKind, FunctionDecompilerError>
Pops an expression from the current basic block’s stack.
Sourcepub fn pop_assignable(
&mut self,
) -> Result<AssignableKind, FunctionDecompilerError>
pub fn pop_assignable( &mut self, ) -> Result<AssignableKind, FunctionDecompilerError>
Pops an assignable expression from the current basic block’s stack.
Sourcepub fn pop_identifier(
&mut self,
) -> Result<IdentifierNode, FunctionDecompilerError>
pub fn pop_identifier( &mut self, ) -> Result<IdentifierNode, FunctionDecompilerError>
Pops an identifier from the current basic block’s stack.
Sourcepub fn push_one_node(
&mut self,
node: AstKind,
) -> Result<(), FunctionDecompilerError>
pub fn push_one_node( &mut self, node: AstKind, ) -> Result<(), FunctionDecompilerError>
Pushes an AST node to the current basic block’s stack.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FunctionDecompilerContext
impl !RefUnwindSafe for FunctionDecompilerContext
impl Send for FunctionDecompilerContext
impl Sync for FunctionDecompilerContext
impl Unpin for FunctionDecompilerContext
impl !UnwindSafe for FunctionDecompilerContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more