<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 9, 2013 at 10:15 AM, Andrew Trick <span dir="ltr"><<a href="mailto:atrick@apple.com" target="_blank">atrick@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="im">On Apr 8, 2013, at 2:55 PM, "Robinson, Paul" <<a href="mailto:Paul_Robinson@playstation.sony.com" target="_blank">Paul_Robinson@playstation.sony.com</a>> wrote:<br>
<div>I keep seeing "this is a layering violation" comments on the lists.<br><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
While there are a few<span> </span><a href="http://llvm.org/" target="_blank">llvm.org</a><span> </span>pages that mention layers in passing,<br>there is nothing (that I've found) actually specifying the layers.<br>Trying to infer the layering from the code is tedious and error-prone<br>
(or we wouldn't see so many violations in code reviews, eh?).<br><br>Now, I understand that Google has some sort of layering checker.<br>Could somebody extract the layering information from that tool<br>and throw it into a web page?  I'm sure it would be helpful to a<br>
number of people, not just me.<br></div></blockquote></div><br></div><div>That would be nice to see, at least for the current state of the code. In the long-term it would be better to auto-generate the page.</div></div></blockquote>
<div><br></div><div style>I hacked together a script that goes over our LLVMBuild.txt files and extracts a dependency tree which can be seen as the layering description. Here's an example with the root on the 'lli' tool: <a href="https://gist.github.com/eliben/5348224">https://gist.github.com/eliben/5348224</a></div>
<div style><br></div><div style>[a dep tree is printed only once for every library to make the output manageable]</div><div style><br></div><div style>This description is incomplete because some dependencies are populated at runtime (notably all the targets being linked), but it seems like a pretty good description of layering in terms of what should or should not depend on something else.</div>
<div style><br></div><div style>If this looks interesting, a better long-term strategy would be to hack /utils/llvm-build/ to dump this when requested with some flag, because it already understands LLVMBuild.txt files (surely to a deeper level than my hackish script).</div>
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">
<div><br></div><div>Meanwhile, does llvm-config --components and llvm-config --libs help you?</div><div><br></div></div></blockquote><div><br></div><div style>These just list the components and libraries, i.e.:</div><div style>
<br></div><div style><div>llvm-config --components</div><div> aarch64 aarch64asmparser aarch64asmprinter aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils all all-targets analysis archive arm armasmparser armasmprinter armcodegen armdesc armdisassembler arminfo asmparser asmprinter bitreader bitwriter codegen core cppbackend cppbackendcodegen cppbackendinfo debuginfo engine executionengine gtest gtest_main hexagon hexagonasmprinter hexagoncodegen hexagondesc hexagoninfo instcombine instrumentation interpreter ipa ipo irreader jit linker mblaze mblazeasmparser mblazeasmprinter mblazecodegen mblazedesc mblazedisassembler mblazeinfo mc mcdisassembler mcjit mcparser mips mipsasmparser mipsasmprinter mipscodegen mipsdesc mipsdisassembler mipsinfo msp430 msp430asmprinter msp430codegen msp430desc msp430info native nativecodegen nvptx nvptxasmprinter nvptxcodegen nvptxdesc nvptxinfo objcarcopts object option powerpc powerpcasmprinter powerpccodegen powerpcdesc powerpcinfo runtimedyld scalaropts selectiondag sparc sparccodegen sparcdesc sparcinfo support tablegen target transformutils vectorize x86 x86asmparser x86asmprinter x86codegen x86desc x86disassembler x86info x86utils xcore xcoreasmprinter xcorecodegen xcoredesc xcoredisassembler xcoreinfo</div>
<div><br></div><div><br></div><div style>So I'm not sure how it helps to see the layers.</div><div style><br></div><div style>Eli</div><div style><br></div><div style><br></div><div style>Eli</div><div style><br></div>
</div><div><br></div><div><br></div><div><br></div></div></div></div>