<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 17, 2011, at 9:33 AM, Chris Lattner wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 16, 2011, at 12:51 AM, Owen Anderson wrote:</div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>That is still the case.  There's two kinds of clients that we care about:</div><div><br></div><div>1) clang and similar clients, which know upfront which set of passes they care about.  Their passes are explicitly initialized when they call createFooPass().  Since they never call the global initializeScalarOpts(), they don't link in Scalar.cpp, instead only linking in those passes for which they call createFooPass().</div><div><br></div><div>2) opt and kin, which <i>need</i> to link/initialize all passes available, so that they can be available from the command line.  These clients <i>do</i> call initializeScalarOpts(), thus forcing linkage of all the passes as desired.</div></div></blockquote><br></div><div>Ok, how about following the existing pattern of putting this in a header file instead of a .cpp file?  With this header, is "LinkAllPasses" needed?  Can we remove LinkAllPasses and just use "InitializeAllPasses" instead?</div></div></blockquote><br></div><div>We can do that, if you want, but we'll still want to have separate headers for LinkAllPasses() vs. LinkAllCodeGen(), etc., so that opt doesn't have to link in all of CodeGen, and vice-versa for llc. </div><div><br></div><div>--Owen</div><br></body></html>