[PATCH] Move the *PassPrinter passes from opt.cpp to a separate file

Eric Christopher echristo at gmail.com
Mon Feb 10 15:30:39 PST 2014


On Mon, Feb 10, 2014 at 3:26 PM, Eli Bendersky <eliben at google.com> wrote:
> On Mon, Feb 10, 2014 at 2:00 PM, Eric Christopher <echristo at gmail.com>
> wrote:
>>
>> Any reason not to go ahead and just put it into lib/IR (alongside the
>> PassManager infrastructure) or some such?
>
>
>
> I guess just the principle of least impact :-) What I mean by that is - this
> seems to be only useful within the context of the opt tool now. My
> medium-range goal is being able to create opt-like tools easily without
> copy-pasting most of opt.cpp; so for this reason, and just because this
> functionality is self contained and thus living in a separate module is good
> engineering practice, moving it into a separate file in tools/opt made
> sense. I agree that if there's a need to use this tool outside tools/opt,
> putting it in lib/IR or some such is a better idea. But we don't know in
> advance, so taking this in smaller steps made sense to me. What do you
> think?
>

Mostly just that the default factoring for things in tools/ doesn't
include "auxiliary files" and that we normally would pull those out
into their own library. We should probably have done that for a few
things already - there's some pretty good boilerplate cut and paste
already :)

But for now splitting it into a separate module inside tools/opt seems
reasonable. (i.e. LGTM).

-eric

> Eli
>
>
>
>
>
>>
>> -eric
>>
>> On Mon, Feb 10, 2014 at 1:49 PM, Eli Bendersky <eliben at google.com> wrote:
>> > I'm looking into cleaning up the main file of the opt tool (more on the
>> > motivation in a separate post). One things that immediately sprints up
>> > is
>> > moving all kinds of self-contained functionality into their own modules
>> > within tools/opt;
>> >
>> > This patch does the same for the *PassPrinter passes. This code is very
>> > old
>> > (seems to be from ~2007) and since then new chunks of functionality was
>> > often added in separate modules, though the analysis pass printers were
>> > left
>> > out.
>> >
>> > PTAL
>> >
>> >
>> > _______________________________________________
>> > llvm-commits mailing list
>> > llvm-commits at cs.uiuc.edu
>> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> >
>
>



More information about the llvm-commits mailing list