[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

Chris Lattner clattner at apple.com
Thu Feb 17 22:13:56 PST 2011


On Feb 17, 2011, at 8:21 PM, Owen Anderson wrote:

>>> 
>>> 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().
>>> 
>>> 2) opt and kin, which need to link/initialize all passes available, so that they can be available from the command line.  These clients do call initializeScalarOpts(), thus forcing linkage of all the passes as desired.
>> 
>> 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?
> 
> 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.

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110217/dca729d4/attachment.html>


More information about the llvm-commits mailing list