Convert most of a class into a vl-genblob.
(vl-class->genblob x) → genblob
Certain fields of a vl-class aren't also fields of a vl-genblob, for instance, a genblob doesn't have warnings, a name, location information, etc.
But aside from these fields, most of a class can be extracted and turned into a genblob for easy processing. After processing the blob, the updated fields can be reinstalled into the class using vl-genblob->class.
Function:
(defun vl-class->genblob (x) (declare (xargs :guard (vl-class-p x))) (let ((__function__ 'vl-class->genblob)) (declare (ignorable __function__)) (b* (((vl-class x))) (make-vl-genblob :id x.name :scopetype :vl-class :vardecls x.vardecls :paramdecls x.paramdecls :fundecls x.fundecls :taskdecls x.taskdecls :typedefs x.typedefs))))
Theorem:
(defthm vl-genblob-p-of-vl-class->genblob (b* ((genblob (vl-class->genblob x))) (vl-genblob-p genblob)) :rule-classes :rewrite)
Theorem:
(defthm vl-class->genblob-of-vl-class-fix-x (equal (vl-class->genblob (vl-class-fix x)) (vl-class->genblob x)))
Theorem:
(defthm vl-class->genblob-vl-class-equiv-congruence-on-x (implies (vl-class-equiv x x-equiv) (equal (vl-class->genblob x) (vl-class->genblob x-equiv))) :rule-classes :congruence)