This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] Fix bug in !interleave operator
ClosedPublic

Authored by Paul-C-Anagnostopoulos on Dec 25 2020, 8:56 AM.

Details

Summary

I forgot to account for the possibility that some elements of the list being interleaved might not be resolved and so final evaluation has to be delayed. Each element must be checked to see if it can be dyn_cast to a StringInit or IntInit.

Diff Detail

Event Timeline

Paul-C-Anagnostopoulos requested review of this revision.Dec 25 2020, 8:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 25 2020, 8:56 AM
llvm/lib/TableGen/Record.cpp
899

I will remove these obsolete lines of code.

Paul-C-Anagnostopoulos updated this revision to Diff 313753.EditedDec 26 2020, 12:04 PM

interleaveIntList() needs to use convertInitializerTo(), not getCastTo. Both can fail, so dyn_cast_or_null is required.

Let's actually update the patch this time.

lattner accepted this revision.Dec 26 2020, 12:43 PM
This revision is now accepted and ready to land.Dec 26 2020, 12:43 PM
This revision was automatically updated to reflect the committed changes.