[cfe-commits] [PATCH]: GPROF implementation

Roman Divacky rdivacky at freebsd.org
Mon Feb 7 09:35:22 PST 2011


hi daniel,

thnx for review! I fixed all the things you didnt like, updated patches
attached.

may I commit this?

I attached two comments below .

> > +  if (!CGM.getCodeGenOpts().GPROFInstrument)
> > +    return;
> 
> I prefer that tests like this be at the call site, not at the caller. As
> written, this function should be called MaybeEmitMCountInstrumentation(), if
> that makes sense?

I copied this from EmitFunctionInstrumentation() which does the checking 
in the caller - you may want to change that.

> > -  // Explicitly warn that these options are unsupported, even though
> > -  // we are allowing compilation to continue.
> > -  for (arg_iterator it = Args.filtered_begin(options::OPT_pg),
> > -         ie = Args.filtered_end(); it != ie; ++it) {
> > -    (*it)->claim();
> > -    D.Diag(clang::diag::warn_drv_clang_unsupported) <<
> > (*it)->getAsString(Args);
> > -  } 
> > +  if (Arg *A = Args.getLastArg(options::OPT_pg))
> > +    if (Args.hasArg(options::OPT_fomit_frame_pointer))
> > +      D.Diag(clang::diag::err_drv_argument_not_allowed_with)
> > +        << A->getAsString(Args) << "-fomit-frame-pointer";
> 
> I think this error makes more sense if the order is reverse, i.e.,
>   clang: error: invalid argument '-fomit-frame-pointer' not allowed with
>   '-pg'

agreed. I copied this from darwin toolchain - you may want to change that
there too.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-gprof.patch
Type: text/x-diff
Size: 7333 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110207/f108c78d/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-gprof-driver.patch
Type: text/x-diff
Size: 2745 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110207/f108c78d/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110207/f108c78d/attachment.sig>


More information about the cfe-commits mailing list