TableGen assertion mechanism

Hi all,

I found myself needing some kind of assertion mechanism in TableGen that would error out whenever a precondition isn't met.
This precondition needs to be checked parse-time, as it's much harder to retroactively verify in the backend in my case.

Is there any simple way to achieve this right now?

I think one could simulate this by doing something invalid (e.g. defining two records with the same name) whenever the precondition evaluates to false, but I'm looking for something cleaner.

Thanks,
Jan