[LLVMdev] [RFC] Removing static initializers for command line options

Chandler Carruth chandlerc at google.com
Wed Sep 17 14:09:28 PDT 2014


On Wed, Sep 17, 2014 at 10:35 AM, Chris Bieneman <beanz at apple.com> wrote:

> On Sep 16, 2014, at 5:28 PM, Chandler Carruth <chandlerc at google.com>
> wrote:
>
> Picking this back up, I think that your patch with some cleanups is
> probably the right starting point. I think the only really substantive
> issue I currently have is that I'd rather have the OptionRegistry in the
> LLVMContext rather than in a singleton method. I understand we'll also have
> to add similar registries to other context objects (MCContext at least),
> but I think it's useful to start off with just one context initially.
>
>
> In my last patches I had the OptionRegistry really just being a template
> type that conformed to the get interface. I was having it be a singleton so
> that we have a way to gradually transition. To make it the context means
> we'll need to change all the pass constructors and the pass macros up
> front. My thoughts on how to phase this in are that we first use the
> template/singleton that I had in my last patches. Then we can update the
> context to conform to the API, and migrate the macros and pass construction
> to pass the context in. After that we can remove the default constructors
> from the passes and replace the template argument with LLVMContext.
>
> Does that sound like a good roadmap for a transition?
>

Hmm, OK. I disagree with some specifics (I don't think we want to do this
in the constructor) but it should be easy to sort that out as it comes up.


>
>
> How do you want to go about the review / cleanups on the patch? Maybe a
> new thread? I have a couple of significant things and probably a bunch of
> really minor cleanup stuff.
>
>
> Sounds good to me. How about I clean up my patches based on your
> recommendations below and start a Phabricator review?


Sure.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140917/a99f27ab/attachment.html>


More information about the llvm-dev mailing list