[PATCH] D43656: TableGen: Allow NAME in template arguments in defm in multiclass

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 26 02:04:12 PST 2018


nhaehnle added a comment.

In https://reviews.llvm.org/D43656#1018010, @tra wrote:

> I'm glad the tests work now, though I suspect it's mostly due to your other changes.


I admit I haven't tested the change standalone on top of trunk, but I suspect it does work standalone.

> I'd replace the test cases with something that does not have unrelated things and only demonstrates that NAME can be used on the right hand side of `def[m] : ` now.

I've just added additional test cases for those, I think there is some use in keeping the other test cases around as well based on the experience I've had refactoring how records are instantiated (I haven't cleaned up those changes yet, they're to come later).

> It looks like use of NAME would also be allowed  for `def` inside multiclass. If that's indeed the case, I'd change the description appropriately.

Yes, and that part has more or less worked already without this change. I've updated the summary to note that.



================
Comment at: test/TableGen/MultiClass-defm-fail.td:16
+  // CHECK: error: Undefined reference:'d1_r1_no_such_record'
+  def _m01: B<!cast<A>(s#"_no_such_record")>;
+}
----------------
tra wrote:
> Presumably you wanted to replace s with NAME here and below to illustrate the effect of the patch.
Hmm, this is a negative test case, so I think it's actually beneficial that it doesn't depend on NAME: it should fail in the same way, whether or not NAME is supported.


Repository:
  rL LLVM

https://reviews.llvm.org/D43656





More information about the llvm-commits mailing list