Vl-expr-leftright-check
Search for strange expressions like A [op] A.
- Signature
(vl-expr-leftright-check x indexy ctx) → warnings
- Arguments
- x — Expression we are considering.
Guard (vl-expr-p x).
- indexy — Heuristic info. We set this to true when we've gone into an
index-like expression, e.g., the 3 in foo[3], the
replication amount in a multiple concatenation, or similar sorts
of contexts. In such a context, we suppress warnings about
A+A, A-A, and A*A, because they are occasionally
useful in indexing arithmetic.
Guard (booleanp indexy).
- ctx — Context where the expression occurs.
Guard (vl-context1-p ctx).
- Returns
- warnings — Type (vl-warninglist-p warnings).
We search through the expression x for sub-expressions of the
form A [op] A, and generate a warning whenever we find one. The ctx
is a vl-context1-p that says where x occurs, for more helpful
warnings. We also use it to suppress warnings in certain cases.
Theorem: return-type-of-vl-expr-leftright-check.warnings
(defthm return-type-of-vl-expr-leftright-check.warnings
(b* ((?warnings (vl-expr-leftright-check x indexy ctx)))
(vl-warninglist-p warnings))
:rule-classes :rewrite)
Theorem: return-type-of-vl-exprlist-leftright-check.warnings
(defthm return-type-of-vl-exprlist-leftright-check.warnings
(b* ((?warnings (vl-exprlist-leftright-check x indexy ctx)))
(vl-warninglist-p warnings))
:rule-classes :rewrite)
Subtopics
- Vl-exprlist-leftright-check