<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 17, 2011, at 10:13 PM, 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 Feb 17, 2011, at 8:21 PM, Owen Anderson wrote:</div><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><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></span></blockquote><br></div><div>Sure, I'm just looking to *reduce* the number of places that have to be touched to add a new pass.</div></div></blockquote><br></div><div>I don't think putting the meta-functions in headers versus in a per-library cpp file really makes a difference on this front.</div><div><br></div><div>Currently, adding a new pass requires touching two places:</div><div>1) Adding a declaration to InitializeAllPasses.h</div><div>2) Adding a call to that function in your per-library cpp file.</div><div><br></div><div>Moving the meta-initializers into headers would make the process:</div><div>1) Adding a declaration to InitializeAllPasses.h</div><div>2) Adding a call to that function in InitializeMyLibrary.h</div><div><br></div><div>Because we want to support clients like clang that <i>don't</i> want to link against every pass, we still need to keep InitializeAllPasses.h in a separate header from the various InitializeMyLibrary() functions.  The "implicit" initialization that clang depends on needs to see those declarations w/o pulling in the link-the-kitchen-sink functions.</div><div><br></div><div>--Owen</div></body></html>