Skip to content

Commit

Permalink
lib/ir: improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Obst committed Oct 30, 2024
1 parent b76835e commit 2a9dbb4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,12 @@ impl Expression {

/// Compute a recursion depth for the expression.
///
/// Because of the recursive nature of the [Expression] type,
/// overly complex expressions are very costly to clone, which in turn can negatively affect some analyses.
/// The recursion depth measure can be used to detect and handle such cases.
/// Equal to the height of the expression's AST.
///
/// Because of the recursive nature of the [Expression] type, overly complex
/// expressions are very costly to clone, which in turn can negatively
/// affect some analyses. The recursion depth measure can be used to detect
/// and handle such cases.
pub fn recursion_depth(&self) -> u64 {
use Expression::*;
match self {
Expand Down
2 changes: 2 additions & 0 deletions src/cwe_checker_lib/src/intermediate_representation/term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ pub struct Tid {
pub type ProgramTid = Tid;
/// Identifier of a function term.
pub type FunctionTid = Tid;
/// Identifier of an external function term.
pub type ExtFunctionTid = Tid;
/// Identifier of a block term.
pub type BlockTid = Tid;
/// Identifier of an instruction term.
Expand Down

0 comments on commit 2a9dbb4

Please sign in to comment.