[llvm-commits] [llvm] r115927 - in /llvm/trunk: include/llvm-c/Core.h include/llvm/InitializePasses.h lib/Transforms/Scalar/Scalar.cpp lib/Transforms/Utils/CMakeLists.txt lib/Transforms/Utils/Utils.cpp lib/VMCore/Core.cpp

Owen Anderson resistor at mac.com
Fri Feb 18 13:10:49 PST 2011


On Feb 17, 2011, at 10:13 PM, Chris Lattner wrote:

> 
> On Feb 17, 2011, at 8:21 PM, Owen Anderson wrote:
>> 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. 
> 
> Sure, I'm just looking to *reduce* the number of places that have to be touched to add a new pass.

I don't think putting the meta-functions in headers versus in a per-library cpp file really makes a difference on this front.

Currently, adding a new pass requires touching two places:
1) Adding a declaration to InitializeAllPasses.h
2) Adding a call to that function in your per-library cpp file.

Moving the meta-initializers into headers would make the process:
1) Adding a declaration to InitializeAllPasses.h
2) Adding a call to that function in InitializeMyLibrary.h

Because we want to support clients like clang that don't 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.

--Owen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110218/d9b745d4/attachment.html>


More information about the llvm-commits mailing list