HomePhabricator

[TableGen] Fix anonymous record self-reference in foreach and multiclass

Authored by jyyou.tw on Feb 1 2021, 7:59 AM.

Description

[TableGen] Fix anonymous record self-reference in foreach and multiclass

If we instantiate self-referenced anonymous records in foreach and
multiclass, the NAME value will point to incorrect record. It's because
anonymous name is resolved too early.

This patch adds AnonymousNameInit to represent an anonymous record name.
When instantiating an anonymous record, it will update the referred name.

Differential Revision: https://reviews.llvm.org/D95309