Page MenuHomePhabricator

Convert TableGen assert to error
ClosedPublic

Authored by stephenneuendorffer on May 18 2021, 5:12 PM.

Details

Summary

This gives a nice message about the location of errors in a large
tablegen file, which is much more useful for users

Diff Detail

Event Timeline

stephenneuendorffer requested review of this revision.May 18 2021, 5:12 PM
stephenneuendorffer created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMay 18 2021, 5:12 PM

Ping... in general is there an issue converting asserts() to proper error messages in tablegen?

Seems fine, but is there a way to write this in tablegen that would trigger the assert?

Seems fine, but is there a way to write this in tablegen that would trigger the assert?

Yes, I hit it with an out of tree backend, but I don't have an easy way to recreate it. Are you concerned about a test?

Seems fine, but is there a way to write this in tablegen that would trigger the assert?

Yes, I hit it with an out of tree backend, but I don't have an easy way to recreate it. Are you concerned about a test?

I'm not all that concerned about a test just trying to get my head around this. I just realized this is counting the number of results from the thing that is being cast which makes a lot more sense. I thought it was trying to count the number of results for the ValueType itself and I couldn't figure out how to write that.

llvm/utils/TableGen/CodeGenDAGPatterns.cpp
2857

case -> cast ?

This revision was not accepted when it landed; it landed in state Needs Review.Jun 1 2021, 1:18 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
stephenneuendorffer marked an inline comment as done.
llvm/utils/TableGen/CodeGenDAGPatterns.cpp
2857

ooo yeah, I'll fix that.