[TblGen] Extend !if semantics through new feature !cond

This patch extends TableGen language with !cond operator.
Instead of embedding !if inside !if which can get cumbersome,
one can now use !cond.
Below is an example to convert an integer 'x' into a string:

    !cond(!lt(x,0) : "Negative",
          !eq(x,0) : "Zero",
          !eq(x,1) : "One,
          1        : "MoreThanOne")

Reviewed By: hfinkel, simon_tatham, greened
Differential Revision: https://reviews.llvm.org/D55758

llvm-svn: 352185
diff --git a/llvm/test/TableGen/cond-empty-list-arg.td b/llvm/test/TableGen/cond-empty-list-arg.td
new file mode 100644
index 0000000..5f4ccad
--- /dev/null
+++ b/llvm/test/TableGen/cond-empty-list-arg.td
@@ -0,0 +1,8 @@
+// RUN: llvm-tblgen %s
+// XFAIL: vg_leak
+
+class C<bit cond> {
+  bit true = 1;
+  list<int> X = !cond(cond: [1, 2, 3], true : []);
+  list<int> Y = !cond(cond: [], true : [4, 5, 6]);
+}