From 2a9dbb4ae2e9462f586e600d60b29ad7ad898914 Mon Sep 17 00:00:00 2001 From: Valentin Obst Date: Wed, 30 Oct 2024 10:44:01 +0100 Subject: [PATCH] lib/ir: improve documentation --- .../src/intermediate_representation/expression.rs | 9 ++++++--- .../src/intermediate_representation/term.rs | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/cwe_checker_lib/src/intermediate_representation/expression.rs b/src/cwe_checker_lib/src/intermediate_representation/expression.rs index 0f97fef2f..fba481f80 100644 --- a/src/cwe_checker_lib/src/intermediate_representation/expression.rs +++ b/src/cwe_checker_lib/src/intermediate_representation/expression.rs @@ -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 { diff --git a/src/cwe_checker_lib/src/intermediate_representation/term.rs b/src/cwe_checker_lib/src/intermediate_representation/term.rs index 9901a1206..6483bf63d 100644 --- a/src/cwe_checker_lib/src/intermediate_representation/term.rs +++ b/src/cwe_checker_lib/src/intermediate_representation/term.rs @@ -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.