<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>