Another possible tracing feature for TableGen

I hacked around a bit with the simple case of tracing just classes and defs (no multiclasses or defms). Below you will see my test file and then the output produced. Note that the regular output from the PrintRecords backend follows the trace, so you can see the final classes and records there. Once the trace can be selective, it makes sense to add another option for PrintRecords that restricts its printing to only the traced records.

Now it gets a bit more difficult.

Hi Paul,

This does seem like the basis for something pretty useful. Filtering
this down seems like it'd be pretty hard -- but maybe people are fine
grep'ing millions of lines of log files :wink:


It's relatively straightforward to filter the records defined by top-level def statements. The problem is filtering the records generated by defm -> multiclass -> defm -> etc. I'm pretty convinced that this requires saving traces of everything and then filtering them at the end, since the names of those records are not resolved until they are added to the master list of records. Also, a def inside a multiclass is only parsed once, regardless of the number of times the multiclass is "invoked" by defm's. So it's not simply a matter of tracing the parsing of the def.

I'm just going to continue puttering with it. Lots to learn in the meantime.