r207203 - CodeGen: Avoid instrumenting implicit Decls more effectively
Justin Bogner
mail at justinbogner.com
Sun Apr 27 23:20:08 PDT 2014
On Sunday, April 27, 2014, Duncan P. N. Exon Smith <dexonsmith at apple.com>
wrote:
> On 2014 Apr 25, at 00:20, Justin Bogner <mail at justinbogner.com<javascript:;>>
> wrote:
>
> > @@ -803,7 +803,7 @@ void CodeGenPGO::assignRegionCounters(co
> > llvm::IndexedInstrProfReader *PGOReader = CGM.getPGOReader();
> > if (!InstrumentRegions && !PGOReader)
> > return;
> > - if (!D)
> > + if (D->isImplicit())
> > return;
>
> If `D` is never `nullptr`, should it be passed by reference instead?
>
Perhaps, but every caller of the function has a pointer in the first place.
I'm not convinced it gains much to have all of the callers dereference
those pointers - it's basically the same crash as now if they're null. I'm
not opposed, but I don't think it's worth it without making a much larger
change to clang's CodeGen interfaces.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140427/4f6a8d76/attachment.html>
More information about the cfe-commits
mailing list