[PATCH] D80865: [TableGen] defm in a loop is not final (bug fix)
Simon Tatham via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 17 01:34:55 PDT 2020
simon_tatham added inline comments.
================
Comment at: llvm/test/TableGen/foreach-multiclass.td:98
foreach _ = !if(b, [0], []<int>) in
def B;
----------------
hfinkel wrote:
> simon_tatham wrote:
> > Of course, we've got a proper `if` statement now! I wonder if it's worth checking that this construction works with that as well as with the `foreach` dodge?
> >
> > (It should, because if I remember, `if` expands to that anyway under the hood. But just in case the implementation changes in future, perhaps.)
> Yep. In real life, I'm using it with the if statement. Because if expands to this, I put it in the test this way (because this is the foreach-multiclass test, and to make it clearer how the test corresponded to the fix). Would you prefer that I also explicitly add a test with an if statement?
That would be my preference, just because the implementation of `if` by `foreach` seemed like the kind of shortcut I wouldn't bet on staying true for ever.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80865/new/
https://reviews.llvm.org/D80865
More information about the llvm-commits
mailing list