Index: lib/TableGen/Record.cpp =================================================================== --- lib/TableGen/Record.cpp +++ lib/TableGen/Record.cpp @@ -673,6 +673,14 @@ PrintFatalError(CurRec->getLoc(), "Undefined reference:'" + Name + "'\n"); } + + if (isa(getType())) { + if (BitsInit *BI = dyn_cast(LHS)) { + if (Init *NewInit = BI->convertInitializerTo(IntRecTy::get())) + return NewInit; + break; + } + } } break; } Index: test/TableGen/cast-list-initializer.td =================================================================== --- /dev/null +++ test/TableGen/cast-list-initializer.td @@ -0,0 +1,10 @@ +// RUN: llvm-tblgen %s | FileCheck %s + +class Foo b> { +// CHECK: list ListOfInts = [170]; +// CHECK: list AnotherList = [170, 7]; + list ListOfInts = [!cast(b)]; + list AnotherList = [!cast(b), !cast({1, 1, 1})]; +} + +def : Foo<{1, 0, 1, 0, 1, 0, 1, 0}>;