This is an archive of the discontinued LLVM Phabricator instance.

TableGen: Remove the cast-from-string-to-variable-reference feature
ClosedPublic

Authored by nhaehnle on Mar 7 2018, 3:14 AM.

Details

Summary

Cast-from-string for records isn't going away, but cast-from-string for
variables is a pretty dodgy feature to have, especially when referencing
template arguments. It's doubtful that this ever worked in a reliable
way, and nobody seems to be using it, so let's get rid of it and get
some related cleanups.

Change-Id: I395ac8a43fef4cf98e611f2f552300d21e99b66a

Diff Detail

Event Timeline

nhaehnle created this revision.Mar 7 2018, 3:14 AM
tra added a comment.Mar 9 2018, 10:13 AM

What happens now when someone attempts to cast a variable name?
Will the !cast remain unresolved or will we see a "symbol X not found" error? Both would be somewhat confusing as that X may be something that is obviously there (e.g. template parameter). I'd rather see an explicit error telling me exactly what's wrong. Something like "!cast to a local symbol is not allowed".

In D44195#1033009, @tra wrote:

What happens now when someone attempts to cast a variable name?
Will the !cast remain unresolved or will we see a "symbol X not found" error? Both would be somewhat confusing as that X may be something that is obviously there (e.g. template parameter). I'd rather see an explicit error telling me exactly what's wrong. Something like "!cast to a local symbol is not allowed".

You'd get an "Undefined reference: 'xxx'" error as if you were referencing a record that doesn't exist. I'm changing that to "Undefined reference to record" to be even more explicit about it.

nhaehnle updated this revision to Diff 138353.Mar 14 2018, 7:43 AM

More explicit error message on undefined reference.

tra accepted this revision.Mar 14 2018, 11:22 AM
This revision is now accepted and ready to land.Mar 14 2018, 11:22 AM
This revision was automatically updated to reflect the committed changes.