slang::analysis::TautologicalCompare class

Lint checks for comparisons (and logical combinations of comparisons) whose result can be determined without knowing the runtime values involved, which almost always indicates a bug.

Public static functions

static void check(AnalysisContext& context, const ast::Symbol& rootSymbol, const ast::BinaryExpression& expr)
Checks the given binary expression and reports any tautological comparisons found to the given analysis context.

Function documentation

static void slang::analysis::TautologicalCompare::check(AnalysisContext& context, const ast::Symbol& rootSymbol, const ast::BinaryExpression& expr)

Checks the given binary expression and reports any tautological comparisons found to the given analysis context.

Only the given expression itself is examined; callers are expected to invoke this for each nested binary expression.