Convert most of a class into a vl-genblob.
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.
(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))))
(defthm vl-genblob-p-of-vl-class->genblob (b* ((genblob (vl-class->genblob x))) (vl-genblob-p genblob)) :rule-classes :rewrite)
(defthm vl-class->genblob-of-vl-class-fix-x (equal (vl-class->genblob (vl-class-fix x)) (vl-class->genblob x)))
(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)