This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] Add optional default value for !cast
AbandonedPublic

Authored by pcwang-thead on Jun 15 2022, 6:01 AM.

Details

Summary

Sometimes we want to get a default value instead of error
raised by TableGen when casting a string to a record, so
we add an optional second parameter to !cast operator as
default value.

If casting fails and default value is specified, we will
get default value and TableGen won't raise any error. If
there is no specified default value, the behivior is the
same as before.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2022, 6:01 AM
pcwang-thead requested review of this revision.Jun 15 2022, 6:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2022, 6:01 AM

Can this be abandoned in favor of the !instanceof change?