Configurable hook for classifying extension warnings.
Extension warnings are very good to have and have helped us to find many bugs. However, we need to be pretty clever to avoid getting too many trivial, nitpicky complaints about assignments that aren't really bugs.
This hook can be used with defattach to customize exactly how extension warnings are filtered out and easily experiment with new heuristics. See vl-classify-extension-warning-default for the arguments. The task of your function is to classify the type of warning to issue. Typically the type should be one of the following:
However in principle you can return any warning type you like.
Note that your function will only be called when there is an extension taking place, so it is generally fine to use a function that is relatively expensive or inefficient here.
Definition:
(encapsulate (((vl-classify-extension-warning-hook * * * * *) => * :formals (lhs-size x-selfsize x ss ctx) :guard (and (natp lhs-size) (natp x-selfsize) (> lhs-size x-selfsize) (vl-expr-p x) (vl-scopestack-p ss) (vl-context-p ctx)))) (local (value-triple :elided)) (defthm symbolp-of-vl-classify-extension-warning-hook (symbolp (vl-classify-extension-warning-hook lhs-size x-selfsize x ss ctx)) :rule-classes :type-prescription))