gbf_core/decompiler/handlers/
nop.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#![deny(missing_docs)]

use crate::{
    decompiler::{
        function_decompiler::FunctionDecompilerError,
        function_decompiler_context::FunctionDecompilerContext, ProcessedInstruction,
        ProcessedInstructionBuilder,
    },
    instruction::Instruction,
};

use super::OpcodeHandler;

/// Handles instructions that are not useful to our decompiler.
pub struct NopHandler;

impl OpcodeHandler for NopHandler {
    fn handle_instruction(
        &self,
        _context: &mut FunctionDecompilerContext,
        _instruction: &Instruction,
    ) -> Result<ProcessedInstruction, FunctionDecompilerError> {
        Ok(ProcessedInstructionBuilder::new().build())
    }
}