<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">For what it's worth: I also had very good experiences with python "specifications" to generate code [1].</div><div class=""><br class=""></div><div class="">Of course it's hard to justify switching all the infrastructure just because of one missing tablegen feature...</div><div class=""><br class=""></div><div class="">- Matthias</div><div class=""><br class=""></div><div class="">[1] Example spec + template: <a href="https://github.com/libfirm/libfirm/blob/master/scripts/ir_spec.py" class="">https://github.com/libfirm/libfirm/blob/master/scripts/ir_spec.py</a></div><div class=""> <a href="https://github.com/libfirm/libfirm/blob/master/scripts/templates/gen_irio.c" class="">https://github.com/libfirm/libfirm/blob/master/scripts/templates/gen_irio.c</a></div><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 23, 2017, at 9:35 AM, Jakob Stoklund Olesen via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Aug 22, 2017, at 14:15, Hal Finkel via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">For situations well beyond TableGen's current language capabilities, we have a decision to make. We can continue extending TableGen until it can meet those needs. Alternatively, we can enable the use of some more-powerful input language. For example, we could allow TableGen to embed Python, and then use Python in order to generate record definitions.</span></div></blockquote></div><br class=""><div class="">For a project that’s not LLVM, I recently had the opportunity to replace both TableGen and *.td files with Python scripts. I found that TableGen’s features were easily matched by Python’s for loops and the ability to define functions. I am pretty happy with the approach so far. AMA</div><div class=""><br class=""></div><div class="">This is a lot easier to do in a green field project than in an old project like LLVM, of course.</div><div class=""><br class=""></div><div class="">Example “.td” file: <a href="https://github.com/stoklund/cretonne/blob/master/lib/cretonne/meta/isa/riscv/encodings.py" class="">https://github.com/stoklund/cretonne/blob/master/lib/cretonne/meta/isa/riscv/encodings.py</a></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">/jakob</div></div>_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>