<div dir="ltr">FWIW, I think the end state we'll end up wanting is what you describe in your email: fine grained dependencies and something like <span style="color:rgb(33,33,33)">libLLVM{AllTargets,</span><span style="color:rgb(33,33,33)">NativeTarget}{AsmPrinters,</span><span style="color:rgb(33,33,33)">AsmParsers,Descs,</span><span style="color:rgb(33,33,33)">Disassemblers,Infos}</span><div><span style="color:rgb(33,33,33)"><br></span></div><div><span style="color:rgb(33,33,33)">I think the "Native" thing can be solved by having a CMake (and llvm-config) level alias that points to a specific single target library. Then I think you could actually build lib/Target/All/... directory tree that provides the "all" libraries and links everything together.</span></div><div><span style="color:rgb(33,33,33)"><br></span></div><div><span style="color:rgb(33,33,33)">Last but not least, I think in this world we'd want each of the narrow, specific interfaces to be *inside* the individual target libraries rather than squeezed into a single header file.</span></div><div><span style="color:rgb(33,33,33)"><br></span></div><div><span style="color:rgb(33,33,33)">But this is a lot of churn and work. So I'm not seeing a huge problem if it is ust too much churn and work and you make the header a textual header for now. I'd document this super clearly in the header and lift it up a directory to live alongside our other textual headers like LinkAllPasses.h</span></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 7, 2017 at 2:10 AM Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">My only alternate ideas are:<div><br></div><div>a) To heck with this only a single target thing.</div><div>b) Autogenerate the entire file and library support as part of the build and have the various functions "defined" in the appropriate libraries.</div><div><br></div><div>I don't really think a) is feasible, and b) is a bit of a stretch too. :\</div></div><div dir="ltr"><div><br></div><div>-eric</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 4, 2017 at 5:37 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ping - any further/other thoughts from folks? I'm not /too/ fussed, but generally like the idea of lib layering being simple/clear/obvious, but understand these are sort of the degenerate/worst case.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 28, 2017 at 12:12 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Nov 28, 2017 at 11:27 AM Reid Kleckner <<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 28, 2017 at 11:23 AM, David Blaikie via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Alternatively we can really say this header is a textual header - it's included generally only once in a whole program, the functions are called only once, etc. Though that does seem a little unfortunate on principle but not much practical problem with it, I think. It'd be nice in theory to be able to depend on the right library, have that bring in the right dependencies, etc.</div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>As designed, TargetSelect.h doesn't fit neatly into the normal way of arranging libraries.</div></div></div></div></blockquote></div></div><div dir="ltr"><div class="gmail_quote"><div><br>Not sure about that - yeah, it's a bit of the degenerate case, for sure.<br><br>But in a build system like Google's, where a lib has other lib dependencies (whereas in the LLVM CMake build it seems libs don't depend on other libs - so every executable has to explicitly list its transitive lib dependencies) it's pretty nice to have these little libraries explicitly in the build graph - much like we have those synthetic library targets in the CMake rules, so it's easy to depend on the right/full things.<br><br>(but because the CMake lib rules for LLVM don't actually describe lib dependencies, I think even 'fixing' this in upstream LLVM wouldn't make the dep situation better - the synthetic targets would just have to expand to the underlying libs + the wrapper/selector lib as well)<br> </div></div></div><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> I'd mark it textual and leave it alone.</div></div></div></div></blockquote></div></div><div dir="ltr"><div class="gmail_quote"><div><br>Yeah, maybe... just makes me a bit sad to have inline functions that can't be trivially out-of-lined if/when desired, because they layering isn't fully/correctly represented in the build system. Modular codegen's been a good justification to flush out & fix several of these tricksy layering violations in LLVM already.<br> </div></div></div><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Alternatively, we could make AllTargetsDescs and AllTargetsInfos and all the other synthetic libraries in CMake into real libaries and sink the bodies of these inline functions into each tiny little library. Doesn't seem quite worth it, though.</div></div></div></div>
</blockquote></div></div></blockquote></div>
</blockquote></div>
</blockquote></div>