[cfe-commits] [patch] Fix pr13844

David Blaikie dblaikie at gmail.com
Sun Nov 11 18:36:18 PST 2012


On Fri, Nov 9, 2012 at 8:16 PM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
> In Sema::MergeVarDecl we already handle merging of storage classes and
> visibility attributes, so part of the code in getLVForDecl is
> duplicated. The one exception is the very peculiar __private_extern__
> where
>
> __private_extern__ int N;
> int N;
>
> is not the same as just
>
> int N;
>
> or
>
> __private_extern__ int N;
>
> so we do need to look at more than one decl to decide the linkage.
> This patch just removes the unnecessary bits. With this the "clang -c"
> time of a Release build in a file with 10k repetitions of
>
> extern int no_such_variable;
>
> goes from 2.724s  seconds to 1.339s seconds. GCC 4.7.2 takes 0.003s,
> so there is still room for improvement (working on it).

Sounds good.
Just out of interest/curiosity, would it be possible/practical/useful
to replace your comments with asserts that show that these cases have
already been correctly handled?

- David




More information about the cfe-commits mailing list