[PATCH] Cleaning up remaining static initializers in Signals.inc

Duncan P. N. Exon Smith dexonsmith at apple.com
Tue Sep 2 15:53:17 PDT 2014


> On 2014 Sep 2, at 18:29, Chris Bieneman <beanz at apple.com> wrote:
> 
> This patch cleans up the remaining static initializers in Signals.inc by converting them to ManagedStatic objects.
> 
> Phabricator review:
> http://reviews.llvm.org/D5159
> 
> Thanks,
> -Chris

In a couple of cases, such as...

> @@ -182,8 +184,8 @@
>    }
>  
>    // Otherwise if it is a fault (like SEGV) run any handler.
> -  for (unsigned i = 0, e = CallBacksToRun.size(); i != e; ++i)
> -    CallBacksToRun[i].first(CallBacksToRun[i].second);
> +  for (unsigned i = 0, e = CallBacksToRun->size(); i != e; ++i)
> +    (*CallBacksToRun)[i].first((*CallBacksToRun)[i].second);
>  
>  #ifdef __s390__
>    // On S/390, certain signals are delivered with PSW Address pointing to

... you're doing an expensive dereference inside a loop.  I'd prefer you
saved the reference at the first dereference in each function and reused
it.

LGTM with that change.



More information about the llvm-commits mailing list