[PATCH] D95308: [TableGen] Fix instantiating multiclass in foreach
Paul C. Anagnostopoulos via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 25 07:54:28 PST 2021
Paul-C-Anagnostopoulos added inline comments.
================
Comment at: llvm/lib/TableGen/TGParser.cpp:3528
+ if (resolve(MC->Entries, Substs, CurMultiClass == nullptr && Loops.empty(),
+ &NewEntries, &SubClassLoc))
return true;
----------------
jyyou.tw wrote:
> Paul-C-Anagnostopoulos wrote:
> > Is there a reason why we shouldn't use !CurMultiClass?
> If defm is placed in foreach and multiclass has foreach, the parsing flow is
>
> parse foreach -> parse defm -> resolve multiclass entries -> resolve foreach of multiclass
>
> In this case, !CurMultiClass is not enough. When resolving foreach of multiclass, Loop.ListValue is resolved as FieldInit only.
> It must be further resolved, so I add Loops.empty() to ensure that.
Sorry, I didn't mean just !CurMultiClass. I meant:
!CurMultiClass && Loops.empty()
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95308/new/
https://reviews.llvm.org/D95308
More information about the llvm-commits
mailing list