[LLVMdev] Please document the layers

Eli Bendersky eliben at google.com
Tue Apr 9 11:44:25 PDT 2013


On Tue, Apr 9, 2013 at 10:15 AM, Andrew Trick <atrick at apple.com> wrote:

> On Apr 8, 2013, at 2:55 PM, "Robinson, Paul" <
> Paul_Robinson at playstation.sony.com> wrote:
> I keep seeing "this is a layering violation" comments on the lists.
>
> While there are a few llvm.org pages that mention layers in passing,
> there is nothing (that I've found) actually specifying the layers.
> Trying to infer the layering from the code is tedious and error-prone
> (or we wouldn't see so many violations in code reviews, eh?).
>
> Now, I understand that Google has some sort of layering checker.
> Could somebody extract the layering information from that tool
> and throw it into a web page?  I'm sure it would be helpful to a
> number of people, not just me.
>
>
> 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.
>

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:
https://gist.github.com/eliben/5348224

[a dep tree is printed only once for every library to make the output
manageable]

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.

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



> Meanwhile, does llvm-config --components and llvm-config --libs help you?
>
>
These just list the components and libraries, i.e.:

llvm-config --components
 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


So I'm not sure how it helps to see the layers.

Eli


Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130409/22f3ecc9/attachment.html>


More information about the llvm-dev mailing list