[LLVMdev] Minor pass manager related question about where to put header files...

Justin Bogner mail at justinbogner.com
Wed Jan 21 14:53:16 PST 2015


Chandler Carruth <chandlerc at gmail.com> writes:
> So the new pass manager makes passes just be classes that implement a
> particular interface. And in the spirit of having boring and unsurprising
> patterns, there really is nothing more to it than that. No memory allocation
> is required, and passes will, by default, be "utilities" which can be run
> directly and on their own.
>
> However, this raises an interesting question. Where should the pass headers
> go? They need to be visible to library consumers in order to build up their
> own interesting pass pipelines. For example, I plan to eventually wrap the
> functionality I've been building for the new pass manager in the 'opt' tool
> into a library, and then its low-tech pass registration system will need to
> include all the headers for all the passes in order to instantiate them for
> particular pass pipelines.
>
> My inclination is to just do the unsurprising thing and mirror the Transforms
> lib structure under include/llvm with per-pass header files. Does anyone see
> problems with this? Concerns they'd like to make sure are addressed now?

SGTM. The familiarity should make things easy to find, and I can't
think of a good reason to do something deliberately different.

> I ask this now because I'm ready to port the first significant transform to
> the new pass manager. =] I have a patch that ports InstCombine, everything
> works, but I need a place to put the header.
>
> -Chandler



More information about the llvm-dev mailing list