Commit d701731b by Enkelmann Committed by Enkelmann

cargo fmt

parent 5343432e
......@@ -14,13 +14,13 @@
use super::interprocedural_fixpoint::{Computation, NodeValue};
use crate::abstract_domain::{BitvectorDomain, DataDomain};
use crate::analysis::graph::{Graph, Node};
use crate::prelude::*;
use crate::term::*;
use crate::utils::log::*;
use petgraph::graph::NodeIndex;
use petgraph::visit::IntoNodeReferences;
use petgraph::Direction;
use std::collections::HashMap;
use crate::prelude::*;
mod context;
mod object;
......
......@@ -33,10 +33,7 @@ pub enum Expression {
rhs: Box<Expression>,
},
/// A unary operation
UnOp {
op: UnOpType,
arg: Box<Expression>,
},
UnOp { op: UnOpType, arg: Box<Expression> },
/// A cast operation for type cast between integer and floating point types of different byte lengths.
Cast {
op: CastOpType,
......@@ -46,10 +43,7 @@ pub enum Expression {
/// An unknown value but with known size.
/// This may be generated for e.g. unsupported assembly instructions.
/// Note that computation of an unknown value is still required to be side-effect-free!
Unknown {
description: String,
size: ByteSize,
},
Unknown { description: String, size: ByteSize },
/// Extracting a sub-bitvector from the argument expression.
Subpiece {
low_byte: ByteSize,
......
......@@ -53,10 +53,7 @@ pub enum Def {
///
/// The size of `var` also determines the number of bytes read from memory.
/// The size of `address` is required to match the pointer size of the corresponding CPU architecture.
Load {
var: Variable,
address: Expression,
},
Load { var: Variable, address: Expression },
/// A memory store operation.
///
/// The size of `value` determines the number of bytes written.
......@@ -66,10 +63,7 @@ pub enum Def {
value: Expression,
},
/// A register assignment, assigning the result of the expression `value` to the register `var`.
Assign {
var: Variable,
value: Expression,
},
Assign { var: Variable, value: Expression },
}
/// A `Jmp` instruction affects the control flow of a program, i.e. it may change the instruction pointer.
......@@ -87,18 +81,12 @@ pub enum Jmp {
/// An indirect intraprocedural jump to the address that the given expression evaluates to.
BranchInd(Expression),
/// A direct intraprocedural jump that is only taken if the condition evaluates to true (i.e. not zero).
CBranch {
target: Tid,
condition: Expression,
},
CBranch { target: Tid, condition: Expression },
/// A direct interprocedural jump representing a subroutine call.
///
/// Note that this is syntactically equivalent to a `Jmp::Branch`.
/// If the `return_` is `None`, then the called function does not return to its caller.
Call {
target: Tid,
return_: Option<Tid>,
},
Call { target: Tid, return_: Option<Tid> },
/// An indirect interprocedural jump to the address the `target` expression evaluates to
/// and representing a subroutine call.
///
......
......@@ -7,8 +7,8 @@ use crate::intermediate_representation::Jmp as IrJmp;
use crate::intermediate_representation::Program as IrProgram;
use crate::intermediate_representation::Project as IrProject;
use crate::intermediate_representation::Sub as IrSub;
use serde::{Deserialize, Serialize};
use crate::intermediate_representation::{Term, Tid};
use serde::{Deserialize, Serialize};
pub mod symbol;
use symbol::ExternSymbol;
......@@ -207,7 +207,10 @@ impl From<Blk> for IrBlk {
} else {
for (counter, ir_def) in ir_defs.into_iter().enumerate() {
ir_def_terms.push(Term {
tid: def_term.tid.clone().with_id_suffix(&format!("_{}", counter)),
tid: def_term
.tid
.clone()
.with_id_suffix(&format!("_{}", counter)),
term: ir_def,
});
}
......@@ -224,7 +227,10 @@ impl From<Blk> for IrBlk {
}
for (counter, ir_def) in ir_defs.into_iter().enumerate() {
ir_def_terms.push(Term {
tid: jmp_term.tid.clone().with_id_suffix(&format!("_{}", counter)),
tid: jmp_term
.tid
.clone()
.with_id_suffix(&format!("_{}", counter)),
term: ir_def,
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment