ctrl_flow/
types.rs

1use thiserror::Error;
2
3
4#[derive(Clone, Copy)]
5pub enum JumpType {
6    UnconditionalJump,
7    ConditionalTaken,
8    ConditionalNotTaken
9}
10
11pub enum BlockType {
12    Instruction(String, Option<String>),
13    Jump(String, usize, JumpType, Option<usize>)
14}
15
16#[derive(Error, Debug)]
17pub enum CFGError {
18    #[error("There was an attempt to find a BasicBlock which doesn't exist.")]
19    MissingBlock,
20    #[error("The current block does not exist inside the BasicBlocks.")]
21    MissingCurrentBlock,
22    #[error("A failure address was expected for a conditional jump and it was not provided.")]
23    ExpectedFailureAddress,
24}