Another possible tracing feature for TableGen

I had another idea for a TableGen tracing feature and would like some feedback. It's quite possible I'm on the wrong track here and that improved backend tracing is what folks really need.

The idea is to add a -trace option to the tblgen command line. With it you can list one or more record names. TableGen would produce a detailed trace of how the record is built: class inheritances, template argument values, surrounding let substitutions, record field values, etc. An anonymous record could be traced once you knew its name.

It might make sense to include a trace level, too, since a fully detailed trace might sometimes show too much information.

I don’t think it’s on wrong track in fact it is definitely a step in right direction :slight_smile: We can definitely improvise it over the time but the idea sounds good to me.

+1 from my side.

Since I started a new thread for this idea rather than continuing the previous TableGen tracing thread, I'm replying to invite a few other people to view this thread, in case they missed it.

I had another idea for a TableGen tracing feature and would like some feedback. It's quite possible I'm on the wrong track here and that improved backend tracing is what folks really need.

The idea is to add a -trace option to the tblgen command line. With it you can list one or more record names. TableGen would produce a detailed trace of how the record is built: class inheritances, template argument values, surrounding let substitutions, record field values, etc. An anonymous record could be traced once you knew its name.

It might make sense to include a trace level, too, since a fully detailed trace might sometimes show too much information.

I like this idea, it's probably more useful than the original one.

The main challenge that comes to mind is that the final name of the
record may only be known quite late in the process. Consider a record
that is the result of a defm in a multiclass, with inheritance added
at multiple steps on the way. During parsing you don't yet know what
the final record name is going to be, so it's going to be difficult to
filter based on that :wink:

That said, I'm curious what you come up with to make it happen. Maybe
a mode in which *every* record keeps around a bit of data describing
where it comes from, so that you can then print it selectively?

Cheers,
Nicolai

Ah, yes, tracing defm's is a whole different thing.

I'm going to start fooling around with this and see what can be done. I'm learning TableGen at the same time, so nothing will happen quickly. Thanks for your encouragement.