[llvm-dev] Another possible tracing feature for TableGen

Nicolai Hähnle via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 13 05:53:20 PDT 2020


On Sun, Aug 9, 2020 at 6:33 PM Paul C. Anagnostopoulos via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> 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 ;)

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

>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



-- 
Lerne, wie die Welt wirklich ist,
aber vergiss niemals, wie sie sein sollte.


More information about the llvm-dev mailing list