<div dir="ltr"><div class="gmail_default" style="font-size:small">I figured out the answer to my problem. I use const MCInstrDesc desc = MCII->get(x) to get the same information. It's just that I was writing TableGen descriptions and so I thought the answer would be in TableGen.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jun 27, 2020 at 10:49 AM Chris Sears <<a href="mailto:chris.sears@gmail.com">chris.sears@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I'd like to store a tablegen generated enumeration in a record field/value. Clearly this enumeration isn't available yet so it seems that a code fragment should be the escape mechanism I need. Looking at the other backends for examples, I see things like<br><br><span class="gmail_default" style="font-size:small"> </span>[{ return Imm >= 0 && Imm < 64; }] // promising<br><span class="gmail_default" style="font-size:small"> </span>code Requires = [{ {} }]; // <span class="gmail_default" style="font-size:small">this </span>looks like a string<br><span class="gmail_default" style="font-size:small"> </span>let Requires = [{ {AArch64::FeatureETE} }]. // <span class="gmail_default" style="font-size:small">which is </span>not promising<br><br>So I think<span class="gmail_default" style="font-size:small"> that</span> <span class="gmail_default" style="font-size:small">this</span> would look something like:<br><br><div><span class="gmail_default" style="font-size:small"> </span>int reg_index = -1;</div><div><div class="gmail_default" style="font-size:small"> ...</div><span class="gmail_default" style="font-size:small"> </span>let reg_index = [{ return XX::R8; }]; <span class="gmail_default" style="font-size:small"> // </span>or<br><span class="gmail_default" style="font-size:small"> </span>let reg_index = [{ {XX::R8} }];<br><br>However, then<span class="gmail_default" style="font-size:small"> </span>I<span class="gmail_default" style="font-size:small"> </span>get errors of the form:<br><br><span class="gmail_default" style="font-size:small"> </span>error: Value 'reg_index' of type 'int' is incompatible with initializer '[{ {XX::R8} }]' of type 'code'<div><div class="gmail_default" style="font-size:small"> error: Value 'reg_index' of type 'int' is incompatible with initializer '[{ return XX::R8; }]' of type 'code'</div><br>Is there a way of doing this? I don't understand TableGen casting but is that necessary?<div><div class="gmail_default" style="font-size:small"></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Ite Ursi</div>