[llvm] [TableGen] Support type aliases via new keyword deftype (PR #79570)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 26 10:01:36 PST 2024


================
@@ -0,0 +1,34 @@
+// RUN: llvm-tblgen %s | FileCheck %s
+// RUN: not llvm-tblgen -DERROR1 %s 2>&1 | FileCheck --check-prefix=ERROR1 %s
+// RUN: not llvm-tblgen -DERROR2 %s 2>&1 | FileCheck --check-prefix=ERROR2 %s
+
+deftype Byte = bits<8>;
+deftype IntList = list<int>;
+deftype ByteList = list<Byte>;
+class Class<Byte b> {
+  Byte byte = b;
+}
+deftype ClassList = list<Class>;
+
----------------
Artem-B wrote:

Can we do `deftype ClassListAlias = ClassList` ?

> Currently, only primitive types are supported

This could use a test case.

https://github.com/llvm/llvm-project/pull/79570


More information about the llvm-commits mailing list