<div dir="ltr"><div>tl;dr: don't worry about it.</div><div><br></div><div>Essentially, marking a field with "field" makes RecordVal::getPrefix return 1. Otherwise, it returns 0. (RecordVal::getPrefix is in include/llvm/TableGen/Record.h). It effectively is just a way to set a bit on a field. It's only used in two places:</div>
<div><br></div><div><div>llvm/utils/TableGen$ git grep '\bgetPrefix\b'</div><div>CodeEmitterGen.cpp:    if (Vals[i].getPrefix() || Vals[i].getValue()->isComplete())</div><div>FixedLenDecoderEmitter.cpp:      if (Vals[i].getPrefix() || Vals[i].getValue()->isComplete())</div>
</div><div><br></div><div>The use for it here is something one of the backend people will have to answer, but my understanding is that this "field" feature is entirely historical. I'm pretty sure that its purpose can be accomplished in another way within the rest of the language without too much trouble. </div>
<div><br></div><div>If you can get rid of the use of getPrefix in the lines above (and remove use of "field" from the .td files), you could then remove "field" from the language. The attached (completely untested) patch should remove "field" from the language.</div>
<div><br></div><div>As long as the replacement for "field" isn't completely insane, I think it would be great to whittle down TableGen's complexity a tiny bit by removing it.</div><div><br></div><div>-- Sean Silva</div>
<div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 23, 2014 at 5:48 AM, Francesco Petrogalli <span dir="ltr"><<a href="mailto:francesco.petrogalli@gmail.com" target="_blank">francesco.petrogalli@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hello,<br><br></div>what is the tablegen keyword 'field' for?<br><br></div>Thanks,<br>
<br></div>Francesco<br></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>