[PATCH] Add support for optimization reports.

Diego Novillo dnovillo at google.com
Mon Mar 31 15:01:38 PDT 2014


On Mon, Mar 31, 2014 at 3:04 PM, Eric Christopher <echristo at gmail.com> wrote:
>
>   Couple of comments here:
>
>   a) The WRPass thing is awkward. No, I don't know how to fix it offhand.

Yeah.  That's what's bugging me the most. I'm hoping Richard can point
me in the right direction with this.

> Comment at: lib/Frontend/CompilerInvocation.cpp:536
> @@ +535,3 @@
> +      // enable line table generation.
> +      Opts.setDebugInfo(CodeGenOptions::DebugLineTablesOnly);
> +    }
> ----------------
> I think this will just set line tables only as opposed to the greater of line-tables-only and whatever we've currently got.

Oh, so if -g -Rpass was given this will downgrade -g to
-gline-tables-only?  Is there a way for me to simply add to the
current -g setting?

>
> ================
> Comment at: lib/Driver/Tools.cpp:3296
> @@ -3295,1 +3295,3 @@
>
> +  if (Arg *A = Args.getLastArg(options::OPT_Rpass_EQ)) {
> +    A->render(Args, CmdArgs);
> ----------------
> Extra braces?

Thanks. Fixed.

>
> ================
> Comment at: lib/CodeGen/CodeGenAction.cpp:390
> @@ +389,3 @@
> +                               diag::Mapping::MAP_REMARK, Loc);
> +    // FIXME: There should be a way of transferring the DILocation
> +    // content into a SourceLocation. We are building the location string
> ----------------
> I'm not sure we can get back to the same encoding, but it could be useful if we wanted to map accordingly.

What I would really want to get at is source ranges, but I doubt
that's easy to map back from IR (or is it?).

> Also did you want the discriminator here?

Hm, perhaps. I'm ambivalent about it. It is a user-facing diagnostic,
but we won't have source ranges available to it. So, perhaps it may be
useful to give a more precise idea of location.

Diego.



More information about the cfe-commits mailing list