[llvm-commits] [cfe-commits] Compiler-rt changes for detecting initialization order problems in Address Sanitizer

Joerg Sonnenberger joerg at britannica.bec.de
Mon Jul 2 10:17:16 PDT 2012


On Mon, Jul 02, 2012 at 11:55:31AM +0400, Kostya Serebryany wrote:
> +  for (ListOfGlobals *l = list_of_globals; l; l = l->next) {
> +    //Poison only globals not defined in this TU
> +    if (!IsGlobalInList(globals, n, l->g)){
> 
> This is N^2, isn't it?
> Even once we get rid of N^2, this will still be not very efficient (due to
> linked list traversal).
> I can live with this for now, but this will need to be fixed before we
> enable the phase.

Would it possible to build a sorted array of all globals first? That
would make the individual check logarithmic and allow more compact
representation in general. A bloom filter might also be a nice
pre-filter.

Joerg



More information about the llvm-commits mailing list