On 2014-Apr-28, at 16:07, Reid Kleckner <[email protected]> wrote:

> On Sun, Apr 27, 2014 at 11:20 PM, Justin Bogner <[email protected]> wrote:
> On Sunday, April 27, 2014, Duncan P. N. Exon Smith <[email protected]> 
> wrote:
> On 2014 Apr 25, at 00:20, Justin Bogner <[email protected]> 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.
> 
> Agreed, most Decls are passed as 'const FooDecl *'.  Let's use that 
> consistently until there's consensus to change.

Okay, sounds good.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to