[PATCH] Fix error in tablegen when second operand of an !if is an empty list.

Duncan P. N. Exon Smith dexonsmith at apple.com
Thu Feb 27 14:22:12 PST 2014


On Feb 27, 2014, at 10:03 AM, Matt Arsenault <Matthew.Arsenault at amd.com> wrote:

>  Ping
> 
> http://llvm-reviews.chandlerc.com/D2724
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Thanks for the testcase (and the ping).  Seems correct to me, but I haven’t
touched TableGen before.

Anyone else care to comment?

I did notice an asymmetry:

===================================================================
--- /dev/null
+++ test/TableGen/if-empty-list-arg.td
@@ -0,0 +1,6 @@
+// RUN: llvm-tblgen %s
+// XFAIL: vg_leak
+
+class C<bit cond> {
+  list<int> X = !if(cond, [1, 2, 3], []);
+}

>From the code it looks like reversing the arguments would still fail:

  list<int> X = !if(cond, [], [1, 2, 3]);

Not sure if that matters, though.



More information about the llvm-commits mailing list